Open yohanboniface opened 9 years ago
Very simple translation management system.
Use tr('yourstring') when you deal with a string that needs to be translatable.
tr('yourstring')
If you have dynamic variables, you can use tr('Title level {level}', {level: yourvar}).
tr('Title level {level}', {level: yourvar})
Use tr.register({string: translation}) to populate the locale.
A new editor option is added, i18n, which, when present, will be used to register new localized strings.
i18n
So to add localized strings, one would do something like:
new Minilslate.simpleEditor(element, { i18n: { 'Paragraph': 'Paragraphe', 'Title level {level}': 'Titre niveau {level}', … } }
Piiing ;)
hey @olivier-m any chance to get that merged on trunk (or reviewed) ? :)
Very simple translation management system.
Use
tr('yourstring')
when you deal with a string that needs to be translatable.If you have dynamic variables, you can use
tr('Title level {level}', {level: yourvar})
.Use tr.register({string: translation}) to populate the locale.
A new editor option is added,
i18n
, which, when present, will be used to register new localized strings.So to add localized strings, one would do something like: