Localise interface text with Lingui and AI
Prepare messages for translators, handle counts as complete phrases and check that labels update when the active language changes.
Localise interface text with Lingui and AI when a label makes sense on screen but becomes ambiguous in a translation file. The lingui-best-practices skill helps an agent choose the appropriate message form for a button, attribute, count or value defined outside a component. That choice affects what the translator sees and when the translation appears.
A remaining-files message is a useful test. Joining a translated noun to an English-shaped sentence leaves little room for a different word order or plural rule. Supplying the whole message preserves that choice for the target language.
What it does
- Mark visible text in its actual interface context.
- Use count-aware messages for zero, one and other quantities.
- Add a translator comment where a short word has two meanings.
- Resolve reusable descriptors with the currently active locale.
- Inspect catalogue changes before discarding obsolete messages.
Install and use
- Provide a permitted JavaScript or TypeScript project with the official Lingui packages and its working extraction and compilation tools.
- Ask, “Prepare the remaining-files label for translation. Keep the sentence together and tell the translator where a customer sees it.”
- Try the message at different counts, switch language and check that the rendered label follows.
FAQ
Source
Made by Lingui. Original skill: lingui-best-practices, published on GitHub under the MIT licence.
View on GitHub