Android strings.xml Parser Reference

// Parsers

Android strings.xml Parser Reference

Technical reference for Android strings.xml parsing in String Catalog, including placeholder safety, XML handling, and normalization behavior.

The Android XML parser reads and writes localization resources from res/values* files.

Detection Rules

  • File extension: .xml
  • Path pattern under res/values.../ directories
  • Must contain Android resource elements

Supported File Patterns

  • res/values/strings.xml (base language)
  • res/values-*/strings.xml locale variants
  • res/values-b+*/strings.xml BCP-47 style locale folders

Parsing Behavior

  • Supports <string>, <plurals>, and <string-array> resource types.
  • Honors translatable="false" where present.
  • Preserves inline markup content such as <xliff:g>.

Locale Normalization Behavior

  • Supports standard locale folders (values-es, values-fr-rCA).
  • Supports BCP-47 style folders (values-b+es+419).
  • Normalizes locale files to a base file grouping key.

Review State Handling

When base language values change, matching non-base variants are marked NeedsReview.

Rename Handling

Android XML parsing is value-driven and does not rely on explicit key-rename metadata.

Write-Back Normalization

  • Escapes bare ampersands safely.
  • Normalizes apostrophes for Android compatibility.
  • Avoids double encoding known HTML entity content.

Edge Cases Handled

  • Mixed legacy and BCP-47 Android folder formats in the same project.
  • Inline markup round-trips where text and XML tags are interleaved.
  • Entity-heavy strings that are vulnerable to double encoding.