Gå til hovedinnhold

Android String Resources format (.xml)

The Android String Resources format reads res/values/strings.xml files as Android string resources, rather than as generic XML. It extracts <string>, <string-array> items, and <plurals> items (by CLDR quantity) as translatable blocks.

Android's resource semantics are honored: entries marked translatable="false" and bare resource references (@string/foo, ?attr/bar) are skipped; positional/printf arguments (%1$s, %d, %%), <xliff:g> do-not-translate spans, inline styling tags, and <![CDATA[…]]> sections are protected as inline codes; and a comment immediately preceding an entry becomes a translator note. Detection is content-based (a <resources> root with at least one string/array/plurals element) so generic XML still routes to the XML format. Output is a byte-faithful splice of the original: only changed values are rewritten, preserving prolog, comments, whitespace, attribute order, entities, and Android backslash escapes.

IDandroidxml
SourceBuilt-in
Extensions.xml
CapabilitiesRead + Write

How kapi reads it

Parameters

ParameterTypeDefaultDescription
extractCommentsbooleantrueVis en XML-kommentar som umiddelbart forekommer før en oppføring, som en oversetternotat på den emitterte blokken. Kommentarer bevares alltid ordrett uavhengig av denne innstillingen.
extractNonTranslatableContentbooleantrueVis <string>/<string-array>/<plurals>-oppføringer merket med translatable="false" som ikke-oversettbart innholdsblokker (synlig for innhenting, hoppes over av MT). Når av, forblir slike oppføringer i ugjennomsiktig skjelett og gjennomgår rundtur ordrett. Bare ressursreferanser er alltid skjelett.
skipNonTranslatablebooleantrueUtelat <string>/<string-array>/<plurals>-oppføringer merket med translatable="false" fra uttrekk. Slike ressurser eies av utviklere og overføres uendret.
skipResourceReferencesbooleantrueEkskluder <string>-verdier som er en ren ressursreferanse (f.eks. @string/foo, ?attr/bar). En referanse er et alias, ikke oversettbar UI-tekst.

Configure it live

Configuration
Loading form…

Examples

Keep non-translatable entries in scope

Extract even entries marked translatable="false".

skipNonTranslatable: false

Processing notes

  • <string>, <string-array> items, and <plurals> items become translatable blocks; plural items are keyed by CLDR quantity.

  • Positional/printf args, <xliff:g>, inline styling, and CDATA are protected as inline codes; Android backslash escapes round-trip verbatim.

  • Detection is Sniff-based so plain XML documents are not claimed.

← Back to the Format Reference