Open osma opened 1 year ago
If we switched to a JSON based message format, it would simplify the implementation of Vue translations as there would be no need to pass specific messages from the backend to the frontend. I opened issue #1525 proposing this.
Issue #1656 is a near-duplicate of this. But we can consider this issue to be the broader task of translations in all Vue components, while #1656 is about providing the framework for doing this.
For Skosmos 3, we have already implemented UI translations for PHP backend code (PR #1466) and Twig templates (PR #1520). But text in Vue components is not yet translated to the UI language, as can be seen for example in the vocab-counts and term-counts components on the vocabulary home page (the texts "Resource counts by type", "Term counts by language" etc. are currently hardcoded and always shown in English):
To fix this, we need to add internationalization support to the Vue components, most likely using Vue i18n.
We also need to provide the Vue components with the correct messages for each language. For Skosmos 2, this was done using global JS variables, like this:
A similar but hopefully less ugly mechanism for passing the messages from the backend to the frontend is needed. One option would be to add the necessary messages to the SKOSMOS global object (see #1438 where it was implemented).