Android XML

Extension .xml
Smartling identifier android
Example File android.xml
Resources

Keys/Variants

Every string is created with key/variant metadata, which is the value of the string.name attribute. If the value of two strings is the same, but the string.name attribute is different, Smartling creates two strings.

String Instructions

String instructions can be set using the instruction_comments_enabled and instruction_attributes directives

Other Information

To exclude a string from translation use the translatable="FALSE" attribute and value in the string tag:

<string name="string_11" translatable="FALSE">This android string has been marked not to be translated using the translatable attribute.</string>

By default, an untranslated string is returned as the source language, but when downloading translated Android XML files via the File API, setting the parameter includeOriginalStrings=FALSE will remove untranslated elements from the file.

Directives

Directive Format

<!-- smartling.[directive_name] = [value] -->

The directive must be a single comment on one line, and there should not be any inline trailing symbols after the directive. Directives apply to all strings that follow them. Directives can be changed throughout the file

placeholder_format_custom

Values:1. Custom regular expression (pcre)
2. NONE - disable custom placeholders
Description:Used to define a custom placeholder format for strings in the file. See Placeholders in Resource Files for more information.
Examples:
<!-- smartling.placeholder_format_custom = \[.+?\] -->

Any characters surrounded by square brackets will be treated as a placeholder.

placeholder_format

Values:NONE; C; IOS; PYTHON; JAVA; YAML; QT; RESX
Description:Used to specify a standard placeholder format. See Placeholders in Resource Files for more information.
Examples:
<!-- smartling.placeholder_format = IOS -->

Specifies iOS-style placeholders for the file.

instruction_comments_enabled

Values:true OR false
Description:If this directive is set to true, any comment in the file is ingested as an instruction for the next string.
Examples:
<?xml version="1.0" encoding="UTF-8"?>
<!-- smartling.instruction_comments_enabled = true -->
<resources>
<!-- Instruction for string1 -->
 <string name="string1">string1</string>

Smartling will capture String1 with the instruction "Instruction for String1"

instruction_attributes

Values:Name of an attribute of string or plurals nodes in your file
Description:Sets attributes of content nodes to be captured as file instructions for strings.
Examples:
<?xml version="1.0" encoding="UTF-8"?>
<!-- smartling.instruction_attributes = comment, note -->
<resources>
    <string name="string1" comment="comment for String01">String01</string>
    <string name="string2" comment="comment for String02" note="note for String02">String03</string>

string1 will be captured with the instruction "comment for String01". string2 will be captured with the concatenated instruction "comment for String02, note for String02"

pseudo_inflation

Values:int - Accepted values are 0-100
Description:Sets the percentage by which original strings are inflated when downloading pseudo translations. If this directive is not set, pseudo translations are 30 percent longer than the original strings.
Examples:
<!-- smartling.pseudo_inflation = 80 -->

Downloaded pseudo translations will increase the length of original strings by 80 percent.