Internationalization
This package includes utilities for working with different languages in the browser.
This package works for client side rendered applications as well as for server side rendered applications.
Table of content
Usage
First, you have to install the package:
npm install @aboutbits/internationalization
Second, you can setup the tool with all supported languages and the fallback language and then detect the given browser language.
import { Internationalization } from '@aboutbits/internationalization'
let supportedLanguages = ['en', 'de', 'it']
let fallbackLanguage = 'en'
let i18n = new Internationalization(supportedLanguages, fallbackLanguage)
let browserLanguage = i18n.detectBrowserLanguage()
let language = i18n.detectLanguage()
i18n.setLanguage("de")
console.log(browserLanguage)
console.log(language)
Build & Publish
To build and publish the package, simply commit all changes and push them to master. Then run one of the following commands locally:
npm version patch
npm version minor
npm version major
Information
About Bits is a company based in South Tyrol, Italy. You can find more information about us on our website.
Support
For support, please contact info@aboutbits.it.
Credits
License
The MIT License (MIT). Please see the license file for more information.