-
Notifications
You must be signed in to change notification settings - Fork 0
installation
Kingcean edited this page May 16, 2020
·
3 revisions
You can install this web front-end library by npm or by downloading the bundled file to insert a script
tag into your web page directly.
npm i langpack
Then you can import the ones you needed by patching. Following is a sample.
import { Resources } from 'langpack';
let res = new Resources();
res.register({
language: "en",
strings: {
name: "App name",
description: "The business logic library."
}
});
console.info(res.getLocaleString("name"));
And of couse, you can import all the library as a namespace to use.
import * as LangPack from 'langpack';
npm i langpack
And you can require the library and patch what you needed. Following is a sample.
const { Resources } = require('langpack');
let res = new Resources();
res.register({
language: "en",
strings: {
name: "App name",
description: "The business logic library."
}
});
console.info(res.getLocaleString("name"));
You can download the bundle file and insert it into your web page, then you can use the global namespace LangPack
. Following is a sample.
const { Resources } = LangPack;
let res = new Resources();
res.register({
language: "en",
strings: {
name: "App name",
description: "The business logic library."
}
});
console.info(res.getLocaleString("name"));