string-resources-convention

Enforce Android strings.xml naming conventions and translator comments.

51|6|Updated Mar 10, 2019
One-click install
npx skills add https://github.com/AniTrend/anitrend-v2 --skill string-resources-convention
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: string-resources-convention
Source: https://github.com/AniTrend/anitrend-v2/tree/main/.agents/skills/string-resources-convention
Command: npx skills add https://github.com/AniTrend/anitrend-v2 --skill string-resources-convention

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Prevents Android string resource bugs and localization regressions by enforcing a consistent naming scheme and mandatory translator comments for every touched resource block.

Core Features & Use Cases

  • Standardized naming pattern: Ensures resources follow {prefix}_{module_or_context}_{specific_identifier} with approved prefixes like label_, title_, action_, error_, and others for clearer maintenance and discovery.
  • Localization-ready formatting rules: Guides correct use of positional placeholders like %1$s / %2$d, formatted="true", and appropriate decisions for getText() vs getString().
  • Mandatory POEditor translator context: Requires an XML comment immediately above each <string>, <plurals>, and <string-array> block so translators have intent, variables, and tone.

Quick Start

Use the string-resources-convention skill when adding or modifying strings.xml entries so the new resources follow the naming pattern and include translator comments for each resource block.

Frequently Asked Questions about string-resources-convention

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I name Android strings.xml resources for better localization?

Name Android strings.xml resources using a structured pattern like `{prefix}_{module_or_context}_{specific_identifier}` with approved prefixes such as `label_`, `title_`, or `action_` to ensure clear maintenance and reliable localization context.

How do I add POEditor translator comments to Android string resources?

Add POEditor translator comments by inserting an XML comment immediately above each `<string>`, `<plurals>`, and `<string-array>` block in strings.xml to provide translators with intent, variables, and tone.

What is the correct way to format positional placeholders in Android strings.xml?

Format positional placeholders in Android strings.xml using syntax like `%1$s` or `%2$d`, set `formatted="true"` where appropriate, and decide between `getText()` and `getString()` based on formatting needs.

Does this Android string naming convention apply to plurals and string arrays?

Yes, the Android string naming convention applies when adding, renaming, or reviewing single strings, plurals, and string arrays across different app modules and UI contexts to prevent localization regressions.

Why do my Android string resources cause localization regressions?

Android string resources cause localization regressions when they lack a consistent naming scheme and mandatory translator comments, making it difficult for translators to understand intent, variables, and tone.

What prefixes should I use for Android string resource naming conventions?

Use approved prefixes like `label_`, `title_`, `action_`, and `error_` for Android string resource naming conventions, following the `{prefix}_{module_or_context}_{specific_identifier}` pattern to ensure clear maintenance and discovery.