This package is now called anti:i18n
.
A simple (The simplest possible? Perhaps) i18n package for Meteor.
Get your localized text in Javascript.
Example: i18n('store.purchase');
.
Get your localized text in Handlebars.
Example: {{i18n "store.purchase"}}
.
Example: {{i18n "path" "here" "there"}}
Provide arguments
Add new text map.
Example:
i18n.map('en', {
sayHello: 'Hi {$1}',
store: {
purchase: 'buy now',
basket: 'basket',
},
path: 'From: {$1} to: {$2}',
'shipping.options': 'shipping',
});
Set your current language.
Example: i18n.setLanguage('en_US')
.
Set your default language. This is the base language, if there is no translation to the currently chosen one, default language will be used instead.
Example: i18n.setDefaultLanguage('en_US')
.
Get the current language code.
Decide whether to show a warning when there's no translation in the current and default language.
false
: Display nothing (default).true
: Display the placeholder in default format,[<%= label %>]
.- String: Display the placeholder in custom format. The given string will be used as underscore template with the following parameters:
label
language
defaultLanguage
Example: i18n.showMissing('[no translation for "<%= label %>" in <%= language %>]');