add-localization
Skill0 starsChanged 56 days agoMITView on GitHub
Add a user-visible string via easy_localization — key naming, where it goes in en-US.json, LocaleKeys codegen, plurals, interpolation, enum-keyed strings, and adding a new locale. Use whenever any text will be rendered to a user, including error messages, semantics labels and accessibility hints.
2 other projects use a version of this.
Adopted by
Most recently taken up by
- microsoft/power-platform-skillstheir own version, first seen Oct 13, 2026
- nisrulz/app-privacy-policy-generatortheir own version, first seen Oct 8, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- nisrulz/app-privacy-policy-generator★ 4.9ksame name
- microsoft/power-platform-skills★ 1.1ksame name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository18 other files it gives its agents.
- payload/AGENTS.mdAGENTS.md
- add-design-tokenSkill
- add-platform-channelSkill
- add-routeSkill
- create-adrSkill
- create-api-providerSkill
- create-ds-componentSkill
- create-dtoSkill
- create-featureSkill
- create-pageSkill
- create-storeSkill
- create-use-caseSkill
- handle-errorsSkill
- plan-featureSkill
- qa-featureSkill
- triage-bug-reportSkill
- write-maestro-flowSkill
- write-testsSkill
The file
We split this skill into the rules it gives an agent
7 rules. About 0 are common, 2 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 14
Add the key to assets/translations/en-US.json.
- Very specific: line 15
Run melos run translations — regenerates lib/gen/locale_keys.g.dart.
- Very specific: line 16
Use LocaleKeys.key.tr() in the widget.
- Distinctive: line 57
Use named args, never string concatenation — word order differs between languages, and a concatenated sentence cannot be translated.
- Distinctive: line 69
Never build a plural with a ternary in Dart.
- Very specific: line 98
Add assets/translations/{lang}-{COUNTRY}.json with the same key tree as en-US.json.
- Very specific: line 99
Add the value to SupportedLocals in lib/core/constants/supported_locals.dart and map it in getLocal.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Add a localized string
Governed by ADR-0012. No string that a user can see or a screen reader can read may be a literal in lib/.
That includes: labels, buttons, hints, validation messages, error text, empty-state copy, snackbars, dialog titles, and Semantics labels.
The loop
- Add the key to
assets/translations/en-US.json. - Run
melos run translations— regenerateslib/gen/locale_keys.g.dart. - Use
LocaleKeys.key.tr()in the widget.
// ❌
Text('Continue with email')
// ✅
Text(LocaleKeys.loginPage_continueWithEmail.tr())Never hand-edit lib/gen/locale_keys.g.dart.
Key naming
Nested JSON; _ in the generated Dart key marks each level.
{
"keywords": { "cancel": "Cancel", "retry": "Retry" },
"loginPage": { "title": "Sign in", "emailHint": "Email" },
"homePage": { "emptyTitle": "Nothing here yet" }
}keywords— strings reused across features: Cancel, Close, Save, Retry, Continue. Check here first; do not add a second "Cancel".{feature}Page— everything scoped to one screen. Match the page name (loginPage,homePage,todoDetailsPage).enums— one sub-object per enum, keyed by the enum value's name.
Key names describe the role, not the text. emptyTitle, not nothingHereYet — the copy will change, the role will not.
Interpolation
{ "homePage": { "greeting": "Hello, {name}", "counter": "{done} of {total} done" } }LocaleKeys.homePage_greeting.tr(namedArgs: {'name': user.firstName});
LocaleKeys.homePage_counter.tr(namedArgs: {'done': '$done', 'total': '$total'});Use named args, never string concatenation — word order differs between languages, and a concatenated sentence cannot be translated.
Plurals
{ "homePage": { "todoCount": { "one": "{} todo", "other": "{} todos" } } }LocaleKeys.homePage_todoCount.plural(count);Never build a plural with a ternary in Dart.
Enum-keyed strings
For a value the server sends, key on the enum name so an unmapped value is visible in the JSON rather than crashing:
{ "enums": { "appVersionTranslationsTitle": { "MINOR": "New tools are ready", "MAJOR": "A new version is available" } } }LocaleKeys.enums_appVersionTranslationsTitle.tr(gender: type.name);
// or: '${LocaleKeys.enums_appVersionTranslationsTitle}.${type.name}'.tr()Semantics labels are localized too
Accessibility labels are user-visible strings. Maestro selects by accessibility id, so these labels are also part of the E2E contract (ADR-0015).
Semantics(
label: LocaleKeys.homePage_addTodoA11y.tr(),
button: true,
child: const Icon(Icons.add),
)Adding a locale
- Add
assets/translations/{lang}-{COUNTRY}.jsonwith the same key tree asen-US.json. - Add the value to
SupportedLocalsinlib/core/constants/supported_locals.dartand map it ingetLocal. melos run translations.
A key present in en-US.json and missing elsewhere renders the raw key path to the user. Keep the trees identical.
Checklist
- No string literal reaching the UI, including errors and semantics labels
- Reusable words in
keywords; screen copy under{feature}Page - Key names describe the role, not the current copy
- Interpolation via
namedArgs; plurals via.plural() melos run translationsrun after editing JSONlib/gen/locale_keys.g.dartnot edited by hand- Every locale file carries the same key tree
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

