Select your cookie preferences

We use essential cookies and similar tools that are necessary to provide our site and services. We use performance cookies to collect anonymous statistics, so we can understand how customers use our site and make improvements. Essential cookies cannot be deactivated, but you can choose “Customize” or “Decline” to decline performance cookies.

If you agree, AWS and approved third parties will also use cookies to provide useful site features, remember your preferences, and display relevant content, including relevant advertising. To accept or decline all non-essential cookies, choose “Accept” or “Decline.” To make more detailed choices, choose “Customize.”

Name:
interface
Value:
Amplify has re-imagined the way frontend developers build fullstack applications. Develop and deploy without the hassle.

Page updated Apr 29, 2024

Internationalization

The AWS Amplify I18n module is a lightweight internationalization solution.

Installation

import { I18n } from 'aws-amplify/utils';

Working with the API

setLanguage()

Sets the active language.

I18n.setLanguage('fr');

In the browser, Amplify detects browser language automatically. For mobile you may want to use other libraries to detect the language, and then set it using Amplify in your code.

putVocabularies()

You can create your custom dictionary and set it as your vocabularies in your app. Dictionary is a JavaScript object that you can implement with different terms and languages.

const dict = {
fr: {
'Sign In': 'Se connecter',
'Sign Up': "S'inscrire"
},
es: {
'Sign In': 'Registrarse',
'Sign Up': 'Regístrate'
}
};
I18n.putVocabularies(dict);

get()

Retrieves a phrase from the dictionary for the active language. If the phrase does not have an entry in the dictionary, the original parameter value will be returned.

I18n.get('Sign In');

API Reference

For the complete API documentation for i18n module, visit our API Reference