Skip to content

Instantly share code, notes, and snippets.

View bodrovis's full-sized avatar
🐱
I are serious. You now step into my profile.

Elijah S. Krukowski bodrovis

🐱
I are serious. You now step into my profile.
View GitHub Profile
var message = "Good day, $1";
$.i18n(message, 'Joe');
var message = "Found $1 {{PLURAL:$1|result|results}}";
$.i18n(message, 1);
var message = "$1 changed {{GENDER:$2|his|her}} profile picture";
$.i18n(message, 'Emma', 'female');
$.i18n({
locale: 'de'
});
// or
$.i18n().locale = 'de';
<html lang="en" dir="ltr">
$.i18n( {
locale: 'en'
} );
$.i18n().load({
en: 'i18n/en.json'
}).done( function() { console.log('done!') } );
$.i18n().load({
en: 'i18n/en.json'
})
{
"@metadata": { },
"en": {
"appname-title": "Example Application"
},
"ru": {
"appname-title": "Демонстрационное приложение"
}
}
{
"@metadata": {
"authors": [
"Me"
],
"last-updated": "2016-09-21",
"locale": "en",
"message-documentation": "qqq"
},
"appname-title": "Example Application",
$ git clone https://github.com/wikimedia/jquery.i18n.git
$ cd jquery.i18n
$ git submodule update --init