Translations

A huge part of this project is support for translations. It is integrated into many parts of the process. The standard way to specify a string in HTML is like this: ${i18Next.t("Text to translate")}.

Once a translation is defined using i18Next, there are 3 potential ways the translation can be handled.

  1. Manual - The locale files (*.json files) are updated with the keys to translate and [[ and ]] surrounding them. This is intended to allow manual translation how you like. You can also use the prompt "translateManualFile.md" to help.
  2. GoogleTranslate - This uses the Google Translate API to translate items. This tends to be one of the cheaper and more reliable options I've seen. The only limitation I've run into is that it doesn't handle different plural forms well. So you may need to use OpenAI or Manual for anything that uses i18Next's pluralization feature.
  3. OpenAI - This uses the OpenAI API to translate items. This is the most expensive option I've seen. It is also the most flexible. It can handle different plural forms well. It can also handle more complex sentences. It is also the most likely to be able to handle new languages.

The setting for which translation to use is defined in your build.ts and the translationSource property for the staticSiteBuild call.