Skip to content

rbettermann/amplify-i18n

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

amplify-i18n

Centralization of locale data collection for AWS Amplify.

Installation

AWS Amplify I18n is available as amplify-i18n package on npm.

$ npm install amplify-i18n --save

Configuration

Somewhere in your app, preferably at the root level, configure Amplify I18n.

Load all locales

If you don't specify any locales to the configure method, all the available locales will be loaded.

import { I18n } from "aws-amplify"
import AmplifyI18n from "amplify-i18n"

AmplifyI18n.configure()
I18n.setLanguage("fr")

Load specific locales

If you want to load only a subset of the available locales, pass an array to the configure method.

import { I18n } from "aws-amplify"
import AmplifyI18n from "amplify-i18n"

const locales = ["en", "fr", "de"]
AmplifyI18n.configure(locales)
I18n.setLanguage("fr")

Locales

Amplify I18n follows the Best Current Practice 47 (BCP47) Tags for Identifying Languages.

Currently the following locales are available:

Tag Language
ar Arabic
de German
en English
es Spanish
fr French
he Hebrew
it Italian
ja Japanese
ko Korean
nl Dutch
pt-BR Portuguese (Brazil)
ru Russian
zh-Hans Simplified Chinese
zh-Hant Traditional Chinese

Translations are provided by Locale for the community ♥️

About

Translations for AWS Amplify

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%