Standalone i18n

How to use gt-next as a standalone i18n library

Overview

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

To do this, simply don’t provide 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-next.

Trade-offs

Using gt-next 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 will automatically translate your app for you.

If your project only uses dictionaries with the useTranslations and getTranslations functions, 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() & getGT() functions, you'll also need to translate your strings manually.

Since there are no keys with inline translations, the CLI tool has a command: gtx-cli generate which will automatically generate template files for your project. You'll just need to edit the template files 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