Skip to main content

I18n Translations

I18n Translations

It is possible to translate ReactJs Extensions.

In order to do it, we recommend i18n.

How to translate an Auravant Extension

I18n makes it easier to translate our applications.

The first step is to install the library, we can do it from the console.

npm install i18next react-i18next

Components to translate an Extension:

  • A .json file for each language we want to include.
  • A .js, en el cual importamos los .json y definimos un idioma por defecto.
  • In our .jsx files, we import the library and access values from .json files.

This .json files are key-value objects, where the value contains the text shown to the user.

"welcome": "Bienvenido!",
"field": "Seleccione un lote",
"farm": "Seleccione un campo"
"welcome": "Welcome!",
"field": "Select a field",
"farm": "Select a farm"

Once we have this .json settled, we can access the translations objects from our project .jsx files.

const App = () => {
const { t, i18n } = useTranslation();
useEffect(() => {
}, []);
return (

This way, the content we see is dynamic. The platform language selected by the user will be also reflected in the extension.