To auto-translate a text for the user, two things have to be done:
- Create a text-field on a page in your config, and fill it with a placeholder name
- Add a translation for the placeholder for a desired language.
Users will then see the translated version of the placeholder.
For instance, the placeholder could be "BUTTON_START_MEASUREMENT", and the translation for it could be
- english: Start measurement
- german: Messung starten
Note
If the user has not selected a language, or if no translation has been stored for their chosen language, they will see the placeholder instead. Always make sure that your placeholders are translated into the languages your expected users will use.
- Navigate to the first page you created (your home screen)
- Create a new element with the type 'note'
- For its title, enter "HOME_TEXT_HINT"
- This name is very descriptive. Just by reading it, another editor might be able to realize that it is some form of hint-text, displayed in the home screen
- By choosing a very clear, unique style (all capital-letters, joined by underscores), it is obvious that this is a placeholder
- Position this element on your page, as done in the first tutorial.
- Save the page.
Now, every user, regardless of their selected language, will now see "HOME_TEXT_HINT" on your home screen. To fix this, head to the next step to translate it.