i18n message in specific language
Posted: Tue Nov 07, 2017 12:14 pm
I need to get an i18n message in an other language than the language of the logged-in user.
I was looking for a function like this
but there was nothing like this.
Of course I could set the user language and switch back after I got my message
but I don't want to do this. If something went wrong the user is lost in a french programm
Has anyone an other idea, how to get the message for a specific language?
Thanks Gregory
I was looking for a function like this
- Code: Select all
i18n.getI18NMessage(i18nKey, langCode);
var textInFrech = i18n.getI18NMessage('my.18n.text', 'fr');
but there was nothing like this.
Of course I could set the user language and switch back after I got my message
- Code: Select all
i18n.setLocale('fr', 'FR');
var textInFrech = i18n.getI18NMessage('my.18n.text', 'fr');
i18n.setLocale('en', 'US');
but I don't want to do this. If something went wrong the user is lost in a french programm
Has anyone an other idea, how to get the message for a specific language?
Thanks Gregory