0.0.1 • Published 6 years ago
i18func v0.0.1
Use
I don't like in some i18n file add different string, and in your code use a atlas. i18func is zero config i18n package, juse in you code like this:
const hello = i18func({ english: 'hello', chinese: '你好' });
console.log(hello);
const personHello = i18func({ english: '__person__, hello', chinese: '__person__, 你好' }, {
person: i18func({ english: 'Mr.Ming',chinese: '小明' });
console.log(personHello);
});
Add other language
If you have mars application, you can add mars language like this:
var language = (
navigator['browserLanguage'] || navigator.language
).toLowerCase();
if (language.indexOf('MarsLanguage') > -1) {
// add i18func language
window.i18func_setLanguage('MarsLanguage');
}
// ok like default use:
const hello = i18func({ english: 'hello', MarsLanguage: '£ª˜√øø˚˜´' });
console.log(hello);
Default languages:
- english;
- chineseTraditional;
- chinese;
- dutch;
- korea;
- french;
- german;
- japanese;
- italian;
- portuguese;
- spanish;
- swedish;
That's all, thank.
i18func is MIT licensed.
0.0.1
6 years ago