Skip to content

Add basic i18n support#6

Open
yohanboniface wants to merge 1 commit into
olivier-m:masterfrom
ideascube:i18n
Open

Add basic i18n support#6
yohanboniface wants to merge 1 commit into
olivier-m:masterfrom
ideascube:i18n

Conversation

@yohanboniface
Copy link
Copy Markdown

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:

new Minilslate.simpleEditor(element, {
    i18n: {
        'Paragraph': 'Paragraphe',
        'Title level {level}': 'Titre niveau {level}',
        …
    }
}

@yohanboniface
Copy link
Copy Markdown
Author

Piiing ;)

@yohanboniface
Copy link
Copy Markdown
Author

hey @olivier-m any chance to get that merged on trunk (or reviewed) ? :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant