Migrate i18next to Lingui with AI
Move an application between translation libraries while accounting for existing locale files, stable message identifiers, plurals and the way the app loads a language.
Migrate i18next to Lingui with AI when an application already has translations that the team cannot afford to discard. The migrate-i18next-to-lingui skill treats this as both a code change and a catalogue conversion. A button label may be straightforward, while a basket message with a count and a product name needs closer attention.
One early choice is whether to retain existing keys as explicit identifiers or adopt messages based on source text. Keeping a familiar key can preserve the link with an existing translation workflow. A small working slice lets the team see the implications before converting every namespace.
What it does
- Map the source and target locale files before changing imports.
- Replace translation calls with the appropriate Lingui message constructs.
- Combine old plural entries into messages that retain the necessary forms.
- Decide how existing namespaces should map to the new catalogues.
- Compile the converted messages and check a translated route in the running app.
Install and use
- Provide the existing i18next project, translations, build configuration and compatible official Lingui packages. Keep a reviewable copy of the current resources.
- Ask, “Migrate the basket first, preserve its existing identifiers and test counts of one and several items in a second language.”
- Compare the catalogue changes and the rendered page before removing obsolete resources.
FAQ
Source
Made by Lingui. Original skill: migrate-i18next-to-lingui, published on GitHub under the MIT licence.
View on GitHub