String. xml

Source: Internet
Author: User

 

 

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 ???

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.