This package has been deprecated

Author message:

Deprecated

@alumis/observables-i18n

2.0.2 • Public • Published

@alumis/observables-i18n

Localization using @alumis/observables.

Example Webpack configuration:

const ObservableI18nPlugin = require("@alumis/observables-i18n");

module.exports = {

    // ...

    plugins: [
        new ObservableI18nPlugin({
            defaultSubtags: "no", // New visitors will have Norwegian set as their language
            subtags: ["no", "en"] // Ordered list of available languages (to be shown in e.g. a dropdown)
        })
    ]
};

Usage examples:

console.log(r("foo").value); /// <i18n key="foo" lang="no">Hei Verden!</i18n>
/// <i18n key="foo" lang="en">Hello World!</i18n>
console.log(r("foo2").value) /// <i18n key="foo2" lang="no" file="file.txt" />
console.log("Default language is ", defaultLanguage);
console.log("Current language is ", currentLanguage.value);
console.log("Available languages are:");
for (let l of languages) console.log(l);

Readme

Keywords

none

Package Sidebar

Install

npm i @alumis/observables-i18n

Weekly Downloads

0

Version

2.0.2

License

GPL-3.0

Unpacked Size

1.31 MB

Total Files

11

Last publish

Collaborators

  • andrewsadduq
  • emilmuller