Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add basic i18n support #6

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

yohanboniface
Copy link

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
Author

Piiing ;)

@yohanboniface
Copy link
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