What are the Slack Archives?

It’s a history of our time together in the Slack Community! There’s a ton of knowledge in here, so feel free to search through the archives for a possible answer to your question.

Because this space is not active, you won’t be able to create a new post or comment here. If you have a question or want to start a discussion about something, head over to our categories and pick one to post in! You can always refer back to a post from Slack Archives if needed; just copy the link to use it as a reference..

Hello all, what is the best/recommended solution to access the translations from glossary in typescr

ULW0Z4150
ULW0Z4150 Posts: 69 🧑🏻‍🚀 - Cadet
edited October 2020 in Help

Hello all,
what is the best/recommended solution to access the translations from glossary in typescript?
Furthermore when I use addSuccessMessage or the other messaging methods to output a message, these are not translated by default. Even for standard features like password change (ProfileController::processPasswordUpdate) the messages are not translated. Any idea what could be the issues here?

Comments

  • Andriy Netseplyayev
    Andriy Netseplyayev Domain Lead Solution Architecture Sprykee Posts: 519 🧑🏻‍🚀 - Cadet

    Hi David,
    One of the solutions we had on another project was to introduce some kind of representation of the glossary that would be a static asset, available for your js app.

  • Andriy Netseplyayev
    Andriy Netseplyayev Domain Lead Solution Architecture Sprykee Posts: 519 🧑🏻‍🚀 - Cadet

    It can be f.e. a json file per locale with key->value or more complex structure, when needed

  • Andriy Netseplyayev
    Andriy Netseplyayev Domain Lead Solution Architecture Sprykee Posts: 519 🧑🏻‍🚀 - Cadet

    you then need to think of how to fill in the content in there - extend the existing glossary command, and run in during the shop setup to pass everything you have in glossary to that file f.e.

  • Andriy Netseplyayev
    Andriy Netseplyayev Domain Lead Solution Architecture Sprykee Posts: 519 🧑🏻‍🚀 - Cadet

    if these are keys/translations that are not used any where then a frontend app, then you can just simply keep it separately and maintain the file manually, keeping there only what you need in js app, and not the whole glossary

  • ULW0Z4150
    ULW0Z4150 Posts: 69 🧑🏻‍🚀 - Cadet

    Thanks I’ll give that a try