name: android-check-pr-translations description: Audit translation accuracy for localized Android resources and guide text files changed in a GitHub PR. Use when asked to check, review, audit, or verify translations in a pull request, including strings.xml, guides, tool keywords, field guides, and other localized guide .txt files. Identifies inaccurate translated content by comparing PR changes against the English source.
Check PR Translations
Audit the translation accuracy of Android string resources and localized guide files changed in a GitHub pull request.
Workflow
Run the extraction script from the skill's folder to get the changed translated content from the PR:
python scripts/extract_pr_strings.py <pr-number>The output includes:
locales: changed translated<string>resources with the English source for each key.files: changed localized guide.txtfiles, including guide pages, field guides, andtool_keywords.txt, with the matchingguides/en-US/...source text.
For each
locales.*.addedentry, comparevalue(translation) againstenglish(source) using the accuracy criteria below.For each
files[]entry, compare the added translated lines against theenglishsource text. Use removed lines and hunk context to understand what changed, but report only inaccuracies present in the added translated content.Report findings as JSON (see Output Format).
Accuracy Criteria
Counts as inaccurate:
- The meaning is changed or distorted
- Content is added that isn't in the source (extra phrases, opinions, embellishments)
- Content is omitted that IS in the source
- Tone is significantly altered (e.g., formal → casual or vice versa) in a way that changes user-facing meaning
- Placeholders/variables (e.g.,
%s,%1$d,%2$s) are missing, reordered incorrectly, or altered - HTML tags or formatting present in source are removed or changed in a way that affects meaning
- The translation introduces region-specific idioms or cultural spin not implied by the source
Does NOT count as inaccurate:
- Natural grammatical restructuring required by the target language
- Pluralization differences due to language rules
- Articles/pronouns added because the target language requires them
- Word order changes due to target language syntax rules
Extraction Script: scripts/extract_pr_strings.py (skill-local)
The script parses the output of gh pr diff and extracts:
- Added and removed
<string>elements fromres/values-*/strings.xmlpatch hunks. - Added and removed lines from localized guide text files under
guides/<locale>/*.txt, excludingguides/en-US.
Usage:
python scripts/extract_pr_strings.py <pr-number>
Output schema:
{
"pr_number": 1234,
"locales": {
"values-pl": {
"added": [{"key": "some_key", "value": "translated text", "english": "English source text"}],
"removed": [{"key": "old_key", "value": "old translated text", "english": "English source text"}]
}
},
"files": [
{
"path": "guides/pl-rPL/tool_keywords.txt",
"locale": "pl-rPL",
"english_path": "guides/en-US/tool_keywords.txt",
"english": "English source text...",
"added": [{"hunk": "@@ ...", "lines": ["translated text"]}],
"removed": [{"hunk": "@@ ...", "lines": ["old translated text"]}]
}
]
}
locales.*.added— strings newly introduced or whose value was changed (new value)locales.*.removed— strings that were deleted or whose value was changed (old value)locales.*.english— the corresponding value fromapp/src/main/res/values/strings.xml; empty string if the key is not found- Only
res/values-*/strings.xmlfiles are included; the Englishres/values/strings.xmlis excluded files[].added— added or changed translated guide lines grouped into contiguous diff blocksfiles[].removed— removed translated guide lines grouped into contiguous diff blocksfiles[].english— the complete matching English source guide file; empty string if the source file is not found
Output Format
Output ONLY a JSON blob:
{
"pr_number": 1234,
"inaccurate_translations": [
{
"key": "key_name or null",
"file": "path/to/file or null",
"locale": "values-xx",
"reason": "Why it is inaccurate"
}
]
}
If all translations are accurate:
{
"pr_number": 1234,
"inaccurate_translations": []
}
Do not output any explanation, commentary, or text outside the JSON blob.
key: use the string resource key forstrings.xmlfindings; usenullfor guide file findings.file: usenullforstrings.xmlfindings; use the localized file path for guide file findings.locale: use the Android resource directory (values-xx) or guide locale (xx,xx-rYY).