Replies: 2 comments 2 replies
-
|
There's no current support for internationalization of templates, but I would be happy to add that with your assistance if you would be ok with that? We could include i18next on the server and specify a convention similar to your suggestion (a t helper function) and specification of where to put the json files. |
Beta Was this translation helpful? Give feedback.
-
|
In my case, the first thing the user has to do, when he starts the app for the first time on a device, is choose a language. Right in the beginning of the app, Here how i check offline status and form to be shown again:
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi i tried to send emails in different languages with this approach:
my-project-root/ └── dexie-cloud/ ├── email-templates/ │ ├── otp-subject.handlebars │ ├── otp-body-html.handlebars │ ├── otp-body-text.handlebars │ └── otp-testdata.json └── locales/ ├── en.json └── de.jsonThen i have modified otp-body-html.handlebars to use the {{t "translation.key"}} helper for all translatable strings.
{{t "otp.your_otp_for"}} {{originName}}: <strong>{{otp}}</strong><br /><br /> <b><u>{{t "otp.warning_heading"}}</u></b><br/> ...I have created en.json and de.json files in the dexie-cloud/locales/ directory with the corresponding translation keys and values that look like this:
{ "otp": { "your_otp_for": "Your One-Time Password for", "warning": "Important Warning", "warning_app": "Enter this OTP only in the mobile app", "and_never_on_a_web_site": "and NEVER on a website.", "warning_web": "Enter this OTP only on the website", "and_never_on_any_other_site": "and NEVER on any other site", "check_the_address_bar_before_entering_it": "Always check the address bar before entering it.", "your_selected_language_is": "Your selected language is" } }I addet the "language" key to the otp-testdata.json:
{ "originName": "myapp.company.com", "otp": "ABCD1234", "otpId": "1234567890", "isApp": false, "email": "[email protected]", "language": "de" }Then i tried to push all of that, but it did not push the locales folder and files:
dexie-cloud@latest templates push
Is there a documentation, how to do those translations?
Thanks for your answers.
Beta Was this translation helpful? Give feedback.
All reactions