Android <xliff:g> Puzzle

Source: Internet
Author: User

Many of the strings.xml in Andorid samples have <xliff:g> tags. Like what:

<stringname= "Countdown" ><xliff:g id= "Time" example= "5days>%1$s</xliff:g>until holiday </ String>. Where Xliff is the abbreviation for Xmllocalization Interchange File format, the Chinese name is XML localized data Interchange format.

Do not understand what the use, there are some articles on the internet, but also did not say clearly and do not have the label of the string is what the difference, it was specially researched.

The xliff:g tag is from the Android document Localizationchecklist (https://developer.android.com/intl/zh-cn/distribute/tools/ localization-checklist.html). There are said in the description:

Markmessage parts that should isn't be translated

Oftenstrings contain contain text that shouldn ' t is translated to other languages. Common examples might is a piece of code, a placeholder for a value, a specialsymbol, or a name. As you prepare-strings for translation, look for andmark text This should remain as-is, without translation, so that T Ranslatorsdon ' t change it.

Mark message parts that should not be translated

Sometimes strings contain text that should not be translated into other languages. Common examples include code, a placeholder for a value, a special symbol, or a name. When you are ready to translate a string, find and mark text that should be left intact without translation, so that the translator does not change the content.

To mark text that should not be translated, use the <xliff:g> placeholder tag. The following example markup ensures that the text "%1 $ s" will not be changed during translation (otherwise the message will be corrupted).

is not to see the above instructions are still confused, anyway, I think I looked and did not see the same. Only know is used to mark scenes that should not be translated. But what is not to be translated scenes, not clear.

So first mark the article, the role of 2:

1. Hope to have the understanding of this piece of the students to help solve doubts, in this expressed gratitude;

2. If you see the answer to the question later, update it back.

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

Android <xliff:g> Puzzle

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.