Android string. xml translation and special characters
Xliff: G> label introduction:
<String name = "appwidget_text_format"> <xliff: G id = "prefix"> % 1 $ S </xliff: G >:< xliff: g id = "time"> % 2 $ S </xliff: G> </string>
This is mainly used in programs to dynamically insert content, for example,
<String name = "time"> current time: <xliff: G id = "prefix"> % 1 $ S </xliff: G> <xliff: g id = "time"> % 2 $ S </xliff: G> </string>
Then use the program, context. getstring (R. String. Time, "10", "05 ");
-- Current Time:
The property ID can be named as needed.
Attribute example indicates an example, which can be omitted
% N $ MS: indicates that the output is a string, and N indicates the number of parameters. The m value can be set with spaces before the output.
% N $ MD: indicates that the output is an integer, and N indicates the number of parameters. To set M, you can place a space before the output, or set it to 0 m, put M 0 before output
% N $ MF: indicates that the output is a floating point number, and N indicates the number of parameters. Setting the m value can control the number of decimal places. For example, when M = 2.2, the output format is 00.00.
Msgid ???