Skip to content

xinix-technology/xin-lang

Repository files navigation

xin-lang

npm i xin-lang

How to use

Create instance of xin-lang at global.

import { Lang } from 'xin-lang';

let lang = window.lang = new Lang();
lang.putTranslations('en', {
  'Home': 'Home',
});
lang.putTranslations('en', {
  'Home': 'Rumah',
});

To use programmatically in javascript

let result = window.lang.translate('Home');
console.log(result); // show me the result

To use from component template scope

<a href="#">[[__global.lang.translate("Home")]]</a>

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published