More Info
Translation
Translation
UI Translation
The UI translation is done using the translation object in the StoreProvider.
The translation object is a dictionary of language codes to language objects.
Example:
const translation = {
en: {
all: "All",
},
pt: {
all: "Todos",
}
};
/* ... */
return (
<StoreProvider
data={data}
config={config}
translation={translation}
>
<CustomMainView />
</StoreProvider>
)Preset translations are available in the @envisioning/app/locale folder.
Example:
import en from "@envisioning/app/locale/en";
import pt from "@envisioning/app/locale/pt";Then, you can use them in the StoreProvider like this:
<StoreProvider
data={data}
config={config}
translation={{ en, pt }}
>
<CustomMainView />
</StoreProvider>Or you can use a preset translation and override some keys:
<StoreProvider
data={data}
config={config}
translation={{ en, pt: { ...pt, all: "Todos" } }}
>
<CustomMainView />
</StoreProvider>