Internationalization

Setup

Internationalization with Stack is very straightforward. Simply pass the lang prop to the StackProvider component, and all the pages will be translated to the specified language.

layout.tsx
1...
2 <StackProvider ... lang={'de-DE'}>
3 ...
4 </StackProvider>
5...

By default, if no language is provided, it will be set to en-US.

You can choose which languages to use by employing your own methods, such as storing the language in localStorage or using the user’s browser language.

Supported languages

  • en-US: English (United States)
  • de-DE: German (Germany)
  • es-419: Spanish (Latin America)
  • es-ES: Spanish (Spain)
  • fr-CA: French (Canada)
  • fr-FR: French (France)
  • it-IT: Italian (Italy)
  • pt-BR: Portuguese (Brazil)
  • pt-PT: Portuguese (Portugal)