Standalone i18n

How to use gt-react as a standalone i18n library

Overview

gt-react has feature parity with many other i18n libraries. This means you can use gt-react as a standalone i18n library without the General Translation platform.

To do this, simply avoid providing any environment variables such as GT_API_KEY or GT_PROJECT_ID.

See our migration guide for more information on migrating from another i18n library to gt-react.

Trade-offs

Using gt-react as a standalone i18n library involves some trade-offs.

Manual translation

You will need to translate your app manually. If you use our platform, we’ll automatically translate your app for you.

If your project only uses dictionaries with the useTranslations function, you’ll need to translate your dictionaries manually, as you would with any other i18n library.

Make sure you load your translated dictionaries with the loadDictionary function.


Manual string translation

If your project is using inline translations with the <T> component or the useGT functions, you'll also need to translate your strings manually.

Because inline translations don’t use keys, the CLI tool provides a command: gtx-cli generate which will automatically generate template files for your project. You’ll then just need to edit those templates with your translations for each language.

Make sure you load your translated strings with the loadTranslations function.

No development translations

How is this guide?

Standalone i18n