android <xliff:g> 疑惑
2015-08-10 01:19
489 查看
在很多的andorid samples中的strings.xml中很多都带有<xliff:g>标签。比如:
<stringname="countdown"><xliff:g id="time" example="5days>%1$s</xliff:g>until holiday </string>。其中Xliff是XMLLocalization Interchange File Format 的缩写,中文名为XML本地化数据交换格式。
不明白是什么用途,网上也有一些文章有相关介绍,但是也都没说明白和不带该标签的字符串有什么区别,故特地研究了一番。
Xliff:g标签出自android文档localizationchecklist中(https://developer.android.com/intl/zh-cn/distribute/tools/localization-checklist.html).里面有说说明为:
Markmessage parts that should not be translated
Oftenstrings contain contain text that shouldn’t be translated to other languages.Common examples might be a piece of code, a placeholder for a value, a specialsymbol, or a name. As you prepare you strings for translation, look for andmark text
that should remain as-is, without translation, so that translatorsdon’t change it.
标记不应翻译的消息部分
有时候字符串中包含不应被翻译为其他语言的文本。 常见的示例包括代码、某个值的占位符、特殊符号或名称。 在准备翻译字符串时,请查找并标记应该保留原样而不需要翻译的文本,这样翻译人员就不会更改这些内容。
要标记不应翻译的文本,请使用 <xliff:g> 占位符标记。以下示例标记可确保文本“%1$s”在翻译过程中不会被更改(否则这条消息会被破坏)。
是不是看了上面的说明仍然一头雾水,反正我是觉得看了和没看差不多。只知道是用于标记不应翻译的场景。但是什么是不应翻译的场景呢,不清楚。
故先标记该文章,作用有2:
1.希望有了解这块的同学帮忙解答疑惑,在此表示感谢;
2.如果后续看到问题答案,以便回来更新。
<stringname="countdown"><xliff:g id="time" example="5days>%1$s</xliff:g>until holiday </string>。其中Xliff是XMLLocalization Interchange File Format 的缩写,中文名为XML本地化数据交换格式。
不明白是什么用途,网上也有一些文章有相关介绍,但是也都没说明白和不带该标签的字符串有什么区别,故特地研究了一番。
Xliff:g标签出自android文档localizationchecklist中(https://developer.android.com/intl/zh-cn/distribute/tools/localization-checklist.html).里面有说说明为:
Markmessage parts that should not be translated
Oftenstrings contain contain text that shouldn’t be translated to other languages.Common examples might be a piece of code, a placeholder for a value, a specialsymbol, or a name. As you prepare you strings for translation, look for andmark text
that should remain as-is, without translation, so that translatorsdon’t change it.
标记不应翻译的消息部分
有时候字符串中包含不应被翻译为其他语言的文本。 常见的示例包括代码、某个值的占位符、特殊符号或名称。 在准备翻译字符串时,请查找并标记应该保留原样而不需要翻译的文本,这样翻译人员就不会更改这些内容。
要标记不应翻译的文本,请使用 <xliff:g> 占位符标记。以下示例标记可确保文本“%1$s”在翻译过程中不会被更改(否则这条消息会被破坏)。
是不是看了上面的说明仍然一头雾水,反正我是觉得看了和没看差不多。只知道是用于标记不应翻译的场景。但是什么是不应翻译的场景呢,不清楚。
故先标记该文章,作用有2:
1.希望有了解这块的同学帮忙解答疑惑,在此表示感谢;
2.如果后续看到问题答案,以便回来更新。
相关文章推荐
- Android SDK 201508可用的镜像下载
- 高仿SinaWeibo新浪微博发布页面话题效果
- Android 编译报错HashSet_jni.h
- android获取屏幕尺寸、密度(判断手机屏幕类型)
- Android核心基础-8.Android四大组件之Activity-2.关闭、传递数据
- Android Binder理解
- Android中几种dialog的实现
- 【Android开源项目分析】TAB导航栏PagerSlidingTabStrip的使用和源码分析
- android动画(Animation)
- mac android studio NDK 安装使用(不用翻墙)
- Android进阶之采用TabHost和RadioButton实现底部页面导航
- android笔记--Intent和IntentFilter详解
- Android中的Handler机制
- 如何通过Android Studio 或者ADT 使用VS的安卓模拟器
- android引导页的实现
- Android FlowLayout
- android学习笔记(7)AbsoluteLayout+FrameLayout+RelativeLayout+TableLayout四大布局方式
- android ftp多线程多任务下载时的listview滑动列表错乱解决方法
- Android小记:ViewStub的使用
- android.content.res.Resources$NotFoundException: String resource ID #0x0