平方X 发表于 2017-9-13 15:57:31

AndroidStudio汉化中的一些统一


>本文由平方X发表于平方X网,转载请注明出处。[http://blog.pingfangx.com/2363.html](http://blog.pingfangx.com/2363.html)

# 0x01 中英混排
理论上会在中英文之前添加空格,如果忘了加就不加了,因为没有找到相关规范.
如果有一些单词不用翻译,不会翻译,则会保留英文原文

# 0x02 可选内容的翻译
以RefactoringBundle.properties中的下列语句为例,可以在安全删除时的提示中测试
```
{0} has {1,choice,1#1 usage that is|2#{1,number} usages that are} not safe to delete
```
{0}表示第0个参数
{1, 表示第1个参数
choice,表示选择
1# 2# 表示选项
{1,number}表示将第一个参数转为number(我不知道为什么要转,因为嵌套于{}中吗),然后拼接在2#的选项里

因此可以翻译为
* {1,choice,1#1 个使用|2#{1,number} 个使用}
(按顺序翻译)
* {1,choice,1#1|2#{1,number}} 个使用
(提取公用部分)
* {1,number} 个使用
(取消分枝)
* {1} 个使用
(取消number)

但是下列翻译是不可以的
* {2,number} 个使用(第1个参数,不是第2个)
* {number} 个使用(要指定参数序号,number不表示该数字)

# 0x03 一些单词的统一翻译
如果有一些单词不用翻译,不会翻译,则会保留英文原文
英文|翻译|备注
-|-|-
remove|移除
delete|删除|两者好像没有区别,但还是根据不同的单词进行不同的翻译
cursor|光标
caret|插入符|与光标区分开
change|更改|如果名词性不强,就使用“变更”
all|全部|不使用“所有”
live template|代码模板|统一翻译
complete|补全|统一翻译为补全
code complete|代码补全|
Popup Menu|弹出菜单
action|操作
parentheses|小括号
brackets,square brackets|中括号,方括号
braces,curly braces|括号,大括号,花括号
angle brackets|尖括号
period|句号
comma|逗号
semicolon|分号
asterisk|星号
i18n,internationalization|国际化
L10n,localization|本地化
Soft Wraps|自动换行
super|超
parent|父|超类父类其实一样吧
evaluated|计算,解析|常用于调试部分,如计算表达式,无法解析字段
expected|预期,期望|如期望一个布尔值
Productivity Features Guide|生产力功能指南|就是统计你使用了哪些功能有助于提高你工作效率
occurrence|匹配项|有时也被翻译为出现,表示查找结果的匹配项
pattern|模式|就是正则、字符串模式,不好翻译
root|根|如git的根目录,项目根目录
argument|参数,实参
parameter|参数,形参|应该是混用的,只是在代码样式→换行和括号中补区分
formal and actual parameters|形参和实参
reference|引用,参考
Emmet|
Schema|


# 0x04 翻译文件的介绍
## lib/resource_en/messages
文件|说明|备注
-|-|-
ActionsBundle.properties|操作|最大的文件,一开始我只想翻译这一个文件来着
AnalysisScopeBundle.properties|
AntBundle.properties|
ApplicationBundle.properties|
CodeEditorBundle.properties|
CodeInsightBundle.properties|
CommonBundle.properties|
CompilerBundle.properties|
CompletionBundle.properties|
DaemonBundle.properties|
DebuggerBundle.properties|
DesignerBundle.properties|
DiagnosticBundle.properties|
DiffBundle.properties|
DomBundle.properties|
DupLocatorBundle.properties|
EditorBundle.properties|
EvaluationFeedbackRequest.html|
ExecutionBundle.properties|
FeatureStatisticsBundle.properties|
FileTypesBundle.properties|
FindBundle.properties|
GraphBundle.properties|
IdeBundle.properties|
InspectionsBundle.properties|检查|该文件非常难翻译,不易复用,语句较长。
JamBundle.properties|
JavadocBundle.properties|
KeyMapBundle.properties|
LangBundle.properties|
LicenseCommonBundle.properties|
OptionsBundle.properties|
PsiBundle.properties|
QuickFixBundle.properties|
RefactoringBundle.properties|重构|也是很难翻译,主要是有一些功能自己没有使用过。
SMTestsRunnerBundle.properties|
StatisticsBundle.properties|
ToolsBundle.properties|
UIBundle.properties|
UsageView.properties|
VcsBundle.properties|
VfsBundle.properties|
XDebuggerBundle.properties|
XmlBundle.properties|

页: [1]
查看完整版本: AndroidStudio汉化中的一些统一