Skip to content
Skip to content
Goodspeed

Connect i18next to your Goodspeed app

Locale detection and JSON translation files generated per locale. lib/i18n.ts wires i18next with expo-localization for automatic language switching. Goodspeed wires i18next into every app that needs it at generation time, so you start with a working integration, not a blank config and a documentation tab.

WHAT GETS WIRED IN

Built into every i18next build

Every app Goodspeed generates with i18next includes these wired integrations from the first build. No manual setup required.

ItemDescriptionStrength
getLocales() from expo-localization detects the device's preferred language and matches it against gasConfig.features.i18n.localesgetLocales() from expo-localization detects the device's preferred language and matches it against gasConfig.features.i18n.locales01
Unrecognized locales fall back to gasConfig.features.i18n.defaultLocale instead of crashingUnrecognized locales fall back to gasConfig.features.i18n.defaultLocale instead of crashing02
DevAgent generates locales/en.json and one file per declared locale with matching key setsDevAgent generates locales/en.json and one file per declared locale with matching key sets03
i18next.init skipped entirely when gasConfig.features.i18n.enabled is false, keeping single-locale apps lightweighti18next.init skipped entirely when gasConfig.features.i18n.enabled is false, keeping single-locale apps lightweight04
.github/workflows/i18n.yml checks translation completeness on PRs, failing if any declared locale is missing a key.github/workflows/i18n.yml checks translation completeness on PRs, failing if any declared locale is missing a key05

Source: gas-template repository · i18n

REAL GENERATED CODE

A snippet from a i18next integration the pipeline ships

This pattern comes directly from the gas-template codebase. The studio generates i18next integration code like this for every app that includes it, not a placeholder you have to fill in yourself.

  1. Locale detection

    // lib/i18n.ts
    function getDeviceLocale(): string {
      try {
        const locales = getLocales();
        const deviceLang = locales[0]?.languageCode
          ?? i18nConfig.defaultLocale;
        if (i18nConfig.locales.includes(deviceLang)) {
          return deviceLang;
        }
        return i18nConfig.defaultLocale;
      } catch {
        return i18nConfig.defaultLocale;
      }
    }
GDaily Allergens

Today's log

Gluten
Tree nuts
Shellfish
Dairy
HomeScanLogProfile

START WITH I18NEXT

Your i18next integration, generated