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.
How kapi reads it
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
extractComments | boolean | true | Vis 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. |
extractNonTranslatableContent | boolean | true | Vis <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. |
skipNonTranslatable | boolean | true | Utelat <string>/<string-array>/<plurals>-oppføringer merket med translatable="false" fra uttrekk. Slike ressurser eies av utviklere og overføres uendret. |
skipResourceReferences | boolean | true | Ekskluder <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
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