android-localization-apply
Skill0 starsChanged 3 months agoMITView on GitHub
Brings an existing Android app's localization in line with spec/android/localization/: audits strings (HardcodedText, MissingTranslation, ImpliedQuantity, translatable=false, string-array misuse, plurals, ICU MessageFormat), locale-correct code (Locale.ROOT, Collator, BidiFormatter), RTL, build wiring (localeFilters, generateLocaleConfig, pseudolocales), the in-app language picker, and per-locale plus @PreviewFontScale previews; then applies the missing pieces with per-item approval (externalised strings, locale config, AppCompatDelegate picker, debug pseudolocales, localeFilters migration, values-b+<lang> directories), closing on green ./gradlew build and lint. Operations: audit (read-only), apply. Invoke to localize or add a language switcher to an existing app. Don't use for a new project, a new screen's strings, or a read-only UI review. Also handles equivalent German-language requests. Supports resume on re-invocation.
In this repository12 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- android-barcode-scanner-scaffoldSkill
- android-compose-uiSkill
- android-debuggingSkill
- android-feature-implementSkill
- android-notification-deriveSkill
- android-perceived-performanceSkill
- android-permissions-deriveSkill
- android-project-scaffoldSkill
- android-test-suite-applySkill
- android-toolchain-upgradeSkill
- android-uvc-microscope-scaffoldSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
16 rules. About 0 are common, 2 are distinctive, and 14 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.
14
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 122
When the operator wants the report on disk, it goes to .audits/android-localization/<YYYY-MM-DD>.md, nowhere else — the location is fixed …
- Very specific: line 138
Read references/localization-audit-rules.md in full — it is the rule set of §A–§F distilled into detectable findings with severities, and …
- Very specific: line 145
Check for uncommitted changes in res/, build scripts, the manifest, and lint.xml.
- Distinctive: line 151
Read-only throughout. Nothing is written — no string, build script, or manifest.
- Very specific: line 153
Enumerate the surface: Every res/values*/ directory per module with its qualifier form (BCP-47 values-b+… versus legacy values-de), its …
- Distinctive: line 174
Run the steps in order. Confirm with the operator at each gate before writing.
- Very specific: line 247
Run ./gradlew build once (it already runs lint via check).
- Very specific: line 249
Run the pseudolocale pass of references/apply-templates.md §9 where a device or emulator is available (REQ-4): the debug build under en-XA …
- Very specific: line 260
Read references/localization-audit-rules.md before the audit and before step 2 — the detectable findings of §A–§F with heuristic, severity, …
- Very specific: line 262
Read references/apply-templates.md in steps 3–7 — lint, build-script, manifest, and string templates.
- Very specific: line 279
Never: write a string, build script, manifest, or Kotlin change in audit, and never write an apply item the operator has not approved in …
- Very specific: line 284
Never: put a translatable="false" entry into a translated file, and never leave a key in a translated file that the default values/ lacks …
- Very specific: line 286
Never: write resourceConfigurations into a build script, and never leave it beside localeFilters (§B, REQ-9).
- Very specific: line 289
Never: call setApplicationLocales off the main thread, and never build its argument from anything but LocaleListCompat.forLanguageTags / …
- Very specific: line 304
When spec/android/localization/ disagrees with this skill, the spec wins.
- Very specific: line 308
Read references/localization-audit-rules.md §7 for the full set.
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 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
Android Localization Apply
Brings the localization of an existing Android app in line with spec/android/localization/:
audit first, then apply the missing pieces one approved item at a time, closing on a green
./gradlew build and lint (REQ-1, REQ-7).
The governing idea is that multilingualism is a set of disciplines that hold from the first
string, not a translation file added at the end: externalised, grammatically safe strings;
one source-of-truth language with lint-gated completeness; a complete per-app language
surface; locale-correct formatting and RTL; a pseudolocale pass before every translation
round. The authoritative rules live in spec/android/localization/; this skill
operationalizes them, never restates them. On any conflict the spec wins — report the gap and
propose a spec change rather than deciding silently (REQ-6).
Grounding specs, in the order they bind this skill: spec/android/localization/ §A (string
resources), §B (resolution and build configuration), §C (per-app language surface), §D
(locale-correct behaviour and RTL), §E (testing and translation workflow), §F (Compose
specifics); spec/android/iconography/ §B (mirrored vectors); spec/android/app-design-navigation/
§A (text-expansion and font-scale layout mechanics); spec/android/test-automation/ §D/§E
(per-locale previews and screenshot lanes); spec/android/project-structure/ §G (lint
configuration placement); spec/android/release-readiness/ (what "done" means for the touched
build).
Why this is a skill, not an agent
- Per-item approval is the contract. Externalising a string, adding a language, rewriting a picker, and migrating a build script are operator decisions that outlive the run (REQ-8); an agent's fire-and-forget shape cannot carry them.
- The persistent artifacts are the deliverable.
strings.xmlfiles, the locale config, the picker, and build-script changes land in the working tree, reviewed in context. - It composes with sibling capabilities. New screens →
android-compose-ui, red build →android-debugging, greenfield →android-project-scaffold; perspec/claude/skill-vs-agent/§Primary decision rule the orchestrator is always a skill. - Counter-dimension considered:
auditalone — scanning every resource file and Kotlin source — would suit an agent's context isolation, andandroid-ux-revieweralready covers localizability read-only. It stays here because its findings are phrased as theapplyitems the operator approves next, so one finding vocabulary serves both.
Boundary vs the sibling capabilities
android-project-scaffold(REQ-12) lays the bilingual baseline into a new project (values-b+de/,generateLocaleConfigwithresources.properties,@PreviewFontScale, the picker). This skill never scaffolds; it starts where a project already exists.android-compose-ui(REQ-13) externalises strings at authoring time for the screen it builds and ships the per-locale previews of that screen. This skill retrofits the same discipline onto screens that already exist and hands any new screen there.android-ux-reviewer(REQ-14) audits UI read-only, localizability included; its report is a valid input toapply. This skill'sauditis broader — resources, build wiring, Kotlin call sites — and is written to feedapply.android-feature-implement(REQ-19) owns feature work across layers and externalises the strings it introduces; it may call this skill when a feature exposes a localization gap.android-debugging(REQ-16) diagnoses a red build or lint run; this skill routes red states there and never guesses at a failure.- Server-delivered text stays content-localization scope (spec Non-Goals); this skill only
ensures the app formats it through ICU
MessageFormat(§D).
German trigger phrases
Respond to these (and equivalents) exactly as to their English counterparts; the frontmatter
description stays English-only per skill-management §Structure.
- "App lokalisieren", "Mach die App mehrsprachig", "Lokalisierung prüfen / auditieren"
- "Strings externalisieren", "Hart codierte Texte in strings.xml auslagern"
- "Sprachumschalter einbauen", "Sprache in der App wechseln", "Sprache pro App merken"
- "Neue Sprache hinzufügen", "Übersetzungen abgleichen", "Pseudolocale-Test", "RTL prüfen"
User-language policy
Detect the operator's language and respond in it (German for this operator). Generated
artifacts stay canonical: Kotlin, Gradle, XML, and identifiers in English; the audit report is
written in English so it stays reviewable alongside the spec corpus. The default values/
holds the English source of truth (§B); translated files carry the target language only.
Operations
Pick one at the start and say which is running. The split is deliberate: audit only
reports, apply writes. Nothing is written into the project before the operator has
approved the item.
audit— the app exists and its localization conformance is unknown. Runs the audit procedure below and writes nothing at all: it produces a findings report on the canonicalCritical/Warning/Suggestion/Infoscale ofspec/claude/review-plan/. When the operator wants the report on disk, it goes to.audits/android-localization/<YYYY-MM-DD>.md, nowhere else — the location is fixed byspec/android/localization/§Acceptance Criteria.apply— findings exist (from this run, a previousaudit, or anandroid-ux-reviewerreport) and the missing pieces are to be written. Runs steps 1–7. Without a finding list it runsauditfirst and says so.
An end-to-end request ("localize the app") is audit then apply back-to-back; announce the
handover so the operator sees the report before anything is written.
Preconditions
Before deciding anything:
- Confirm the working directory is a git repository holding an Android project with a Gradle
application module. Without one, stop and route to
android-project-scaffold. - Read
references/localization-audit-rules.mdin full — it is the rule set of §A–§F distilled into detectable findings with severities, and every audit finding cites it. - Establish the AGP version (decides
localeFiltersversusresourceConfigurationsandgenerateLocaleConfigavailability),minSdk(decidesLocaleManagerversusAppCompatDelegate, and whether theautoStoreLocalesservice is needed), the module graph (which modules own resources), the existing locale set (values-*directories), and whether alint.xmlexists. - Check for uncommitted changes in
res/, build scripts, the manifest, andlint.xml. If dirty, report and ask whether to stash, commit, or abort — never overwrite unconfirmed work (REQ-8).
Audit procedure (operation audit)
Read-only throughout. Nothing is written — no string, build script, or manifest.
- Enumerate the surface. Every
res/values*/directory per module with its qualifier form (BCP-47values-b+…versus legacyvalues-de), its strings, plurals, and arrays; thelint.xmlseverities; theandroidResourcesandbuildTypes.debugblocks; the manifest (supportsRtl,localeConfig,autoStoreLocales); everysetApplicationLocales/LocaleManagercall site; the screen-level composables with their preview annotations. - Run lint once, read-only.
./gradlew :app:lintDebug(or the project's debug variant) and read the report forHardcodedText,MissingTranslation,ExtraTranslation,ImpliedQuantity,RtlHardcoded,MissingQuantity,StringFormatInvalid; note their configured severities — a MUST-level check below error severity is itself a finding (§A/§B). - Walk the rules. Apply every heuristic in
references/localization-audit-rules.md§1–§6: string hygiene (§A), completeness and build wiring (§B), the language surface (§C), locale-correct code and RTL (§D), pseudolocales and workflow (§E), Compose reads and previews (§F). - Report on the canonical scale:
Criticalfor a breached MUST or MUST NOT,Warningfor a breached SHOULD,Suggestionfor a MAY worth adopting or a SHOULD deliberately deferred,Infofor a surface scanned clean. Each finding carries the file and line, the spec section, and theapplyitem that would fix it. A choice no spec settles is reported as a gap with a proposed extension (REQ-6).
Procedure (operation apply)
Run the steps in order. Confirm with the operator at each gate before writing.
1. State the target in one sentence
Restate what the operator wants — "the app ships English and German, switchable in-app, and passes the pseudolocale pass" is answerable; "better i18n" is not. Fix the supported locale set with the operator: the spec fixes the mechanics, never the set (Non-Goals). Gate: confirm the restatement and the locale set.
2. Build the apply plan
Derive the item list from the findings, in this order (each item assumes the earlier ones):
lint severities (§A/§B); resourceConfigurations → androidResources.localeFilters
migration and generateLocaleConfig with resources.properties (or repair of a manual
locales_config.xml) (§B/§C); supportsRtl and the autoStoreLocales service in the
manifest (§C/§D); externalisation of hard-coded strings and repair of placeholders, plurals,
translatable="false" misuse, and index-matched <string-array> user text (§A); missing
values-b+<lang>/ directories and key-set drift (§B/§E); the in-app language picker (§C);
locale-correct code fixes — Locale.ROOT, Collator, BidiFormatter, java.time/ICU
formatters, ICU MessageFormat for programmatic templates (§D); isPseudoLocalesEnabled on
debug (§E); per-locale previews and @PreviewFontScale (§F); optionally the grammatical
inflection surface (§C SHOULD). Present the list with the files each item touches. Gate:
confirm the list; the operator may drop items.
3. Fix build wiring, lint, and manifest
From references/apply-templates.md §1–§3: lint.xml severities (merged into an existing
file, never replacing it), the androidResources { localeFilters += …; generateLocaleConfig
= true } block plus res/resources.properties, isPseudoLocalesEnabled = true on the debug
build type, android:supportsRtl="true", and the autoStoreLocales metadata service. When
resourceConfigurations is present, replace it in the same hunk — never leave both (REQ-9).
On AGP below the localeFilters cut-over, report the version gap and route to
android-toolchain-upgrade rather than writing the deprecated form. Confirm before every
write to an existing file (REQ-8). Checkpoint after each item.
4. Externalise and repair strings
Per finding, from references/apply-templates.md §4: move the literal into values/strings.xml
under a feature-prefixed name and read it via stringResource/pluralStringResource (or
getString outside composables); make placeholders positional; merge concatenated sentences
into one string with placeholders; convert count text to <plurals> with other and the
number as a placeholder; move translatable="false" entries out of translated files; replace
index-matched user-text arrays with @string references. Existing keys are never renamed
wholesale — a rename touches every locale file and is confirmed per key. Checkpoint after
each file.
5. Add languages and the picker
From references/apply-templates.md §5–§6: create each missing values-b+<lang>/strings.xml
with the same key set as values/, seeded from the English source and clearly marked as
draft — a draft translation is transient per §B/§E, and the report names every visible string
that still needs human review. A drafted translation is draft quality only (§E), and says so. Then add the picker: an AppCompatActivity host,
AppCompatDelegate.setApplicationLocales(LocaleListCompat.forLanguageTags(tag)) on the main
thread, "system default" via getEmptyLocaleList(), options derived from the declared locale
config, and — only when minSdk >= 33 — the framework LocaleManager (§C). A dropped
language resets stored locales that point at it. Confirm before writing the picker into an
existing settings screen; a wholly new screen is routed to android-compose-ui with what it
must express. Checkpoint after each item.
6. Fix locale-correct code and previews
From references/apply-templates.md §7–§8: Locale.ROOT on internal keys, Collator on
user-visible sorting, BidiFormatter.unicodeWrap on free-direction inline data,
java.time/ICU formatters in place of hand-built patterns, ICU MessageFormat for programmatic
templates, remember keyed on the configuration where it caches locale-dependent values,
start/end in place of left/right, android:autoMirrored="true" on directional vectors (§D,
iconography §B). Add @Preview(locale = "de"), an RTL @Preview(locale = "ar"), and
@PreviewFontScale (singular) to every screen-level composable that lacks them (§F). Each
existing Kotlin file is patched only for the finding named in the plan, never rewritten.
Checkpoint after each file.
7. Verify, run the pseudolocale pass, and hand off
- Run
./gradlew buildonce (it already runs lint viacheck). It must be green; report every failure with its output and route a red build toandroid-debugging(REQ-7). - Run the pseudolocale pass of
references/apply-templates.md§9 where a device or emulator is available (REQ-4): the debug build underen-XA(expansion, leaked hard-coded strings, concatenation) andar-XB(mirroring, left/right leakage), and 200 % font scale; where none is available, state that the pass is pending and which previews stood in for it. - Re-run the audit heuristics over the touched surface and confirm no
Criticalremains. - Report, in the operator's language: the locale set, every item applied or dropped, every key added, the drafts needing human review, the verification and pseudolocale-pass results, and any spec gap. Never leave a red, skipped, or unrunnable element unreported (REQ-1, REQ-7).
Reference files
- Read
references/localization-audit-rules.mdbefore the audit and before step 2 — the detectable findings of §A–§F with heuristic, severity, and fix, plus the gotchas. - Read
references/apply-templates.mdin steps 3–7 — lint, build-script, manifest, and string templates; the picker; locale-correct code; previews; the pseudolocale pass.
Resumability
Per spec/claude/resumable-work/, this skill is resumable: true. State is persisted to
.resume/android-localization-apply/<run-id>.yml after every gate and at each named step
boundary. On re-invocation, scan .resume/android-localization-apply/*.yml for files with
status: in_progress whose inputs: snapshot (repository + operation + locale set) matches
the current request; when one matches, prompt
Resume run <run_id> from phase <phase> (last checkpoint <last_checkpoint_at>)? [resume / start-new / discard].
resume re-hydrates and re-asks no answered gate; start-new leaves the old file intact;
discard deletes it. Fail closed on unparseable or higher-schema_version files. The envelope
keys and lifecycle are load-bearing in the spec and are not duplicated here.
Hard rules
- Never write a string, build script, manifest, or Kotlin change in
audit, and never write anapplyitem the operator has not approved in the plan (REQ-8). - Never inline a user-visible string in code, build a sentence from translated fragments,
use sequential placeholders, or put translatable user text in an index-matched
<string-array>(§A). - Never put a
translatable="false"entry into a translated file, and never leave a key in a translated file that the defaultvalues/lacks (§A/§B). - Never write
resourceConfigurationsinto a build script, and never leave it besidelocaleFilters(§B, REQ-9); never write a second hard-coded language list for the picker when the declared locale config can be read (§C). - Never call
setApplicationLocalesoff the main thread, and never build its argument from anything butLocaleListCompat.forLanguageTags/getEmptyLocaleList(§C). - Never hand-build a date or number pattern, lower-case an internal key with the user
locale, or sort user-visible text without a
Collator(§D). - Never rename existing keys wholesale, rewrite a
strings.xmlfile, or replace an existinglint.xmlwithout per-file confirmation (REQ-8). - Never present a drafted translation as ship quality; every visible drafted string is named for human review (§E).
- Never scaffold a new project or author a new screen; route to
android-project-scaffoldandandroid-compose-ui. - Always report a localization choice no spec settles — regional variants, TMS adoption, a lint check for naming, the picker's option-derivation mechanism below API 33 — as a gap with a proposed extension instead of deciding silently (REQ-6).
- Always close
applyon green./gradlew buildand lint, and route a red build toandroid-debugging(REQ-7). - When
spec/android/localization/disagrees with this skill, the spec wins.
Gotchas
Read references/localization-audit-rules.md §7 for the full set. The three that most often
produce a wrong result:
- The preview
localeparameter setsLocalConfigurationonly. Code that readsLocale.getDefault()in UI renders the host locale in adepreview and passes for the wrong reason; read throughstringResourceand the composition-local configuration. ImpliedQuantityfires on a plural whose text omits the number. "one" covers 101 in some languages, so<item quantity="one">One item</item>is a lint error, not a style nit; every quantity string carries the number.@PreviewFontScaleis singular. A plural spelling does not compile.
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.

