setTexts
The chat package includes built-in i18n strings (currently only in English), if you wish to use a different language or simply a different string you can use the setTexts
function.
This package exports a function setTexts
which can be used to override the internal i18n strings. This is done by either passing the string of a different built-in language or by passing a language object.
Example
Set the chat to use the internal French translation.
import { setTexts } from '@travpro/react-chat';
setTexts('fr');
Set the chat to use the same language object as the app
import { setTexts } from '@travpro/react-chat';
import en from 'locales/en';
setTexts(en);