@grandlinex/bundle-multilang
TypeScript icon, indicating that this package has built-in type declarations

0.32.2 • Public • Published

GrandLineX Multilang Bundle

Multilang support for GrandLineX

Description

img

GrandLineX is an out-of-the-box server framework.

GitHub NPM TS

Status

Quality Gate Status Security Rating Maintainability Rating Reliability Rating Coverage

Issues

Bugs Vulnerabilities Code Smells

Store Variables

Key Description
GLX_TRANSLATION_PATH Path to translation *.json files

Install

Example

class TestKernel extends CoreKernel<any> {
  constructor(appName:string, appCode:string) {
    super( { appName, appCode});
    
    // ...

    /** 
     * optional set the root path for translations
     * -> alternatively you can pass the path in  .env file GLX_TRANSLATION_PATH=$PATH
     */
    const pathToTranslation=""; //  Set path to folder containing translation files
    const store = this.getConfigStore();
    store.set(LangClient.STORE_TRANSLATION_PATH,pathToTranslation)

    
    const defaultLangKey="en"; // Set the default lang key
    this.addModule(new LangModule(this,defaultLangKey));
    
  }
}

Translation format

File naming $key-$name.json like en-English.json or de-German.json

{
  "test.key.first": "helloWorldEn",
  "test.key.second": "helloWorld2En"
}

Documentation

Package Sidebar

Install

npm i @grandlinex/bundle-multilang

Weekly Downloads

63

Version

0.32.2

License

BSD-3-Clause

Unpacked Size

46.6 kB

Total Files

42

Last publish

Collaborators

  • elschnagoo