-
Notifications
You must be signed in to change notification settings - Fork 324
Internationalization (i18n)
Instance of class Streami18n
should be provided to the Chat component to handle translations.
Stream provides the following list of built-in translations for components:
- English (en)
- Dutch (nl)
- Russian (ru)
- Turkish (tr)
- French (fr)
- Italian (it)
- Hindi (hi)
The default language is English. The simplest way to start using chat components in one of the in-built languages is the following:
Simplest way to start using chat components in one of the in-built languages would be following:
const i18n = new Streami18n({ language: 'nl' });
<Chat client={chatClient} i18nInstance={i18n}>
...
</Chat>;
If you would like to override certain keys in in-built translation:
const i18n = new Streami18n({
language: 'nl',
translationsForLanguage: {
'Nothing yet...': 'Nog Niet ...',
'{{ firstUser }} and {{ secondUser }} are typing...':
'{{ firstUser }} en {{ secondUser }} zijn aan het typen...',
},
});
You can find all the available keys here: https://github.com/GetStream/stream-chat-react-native/tree/master/src/i18n
They are also exported as a JSON object from the library.
import {
enTranslations,
nlTranslations,
ruTranslations,
trTranslations,
frTranslations,
hiTranslations,
itTranslations,
esTranslations,
} from 'stream-chat-react-native'; // or 'stream-chat-expo'
Please read this docs on i18n for more details and further customizations - https://getstream.github.io/stream-chat-react-native/#streami18n