版本 Diff 差异对比

条目:可定制的本地化 · 对比历史版本与当前版本间的真实 Wikitext 差异

+26 行新增-26 行移除
历史基准版本Rev #59357
文本替换 - 替换“[[Category:改派教程”为“[[Category:模组制作”
Pokewiz2019-09-11 08:02:51
当前最新版本Rev #68844
当前线上生效正文
自由之民2020-05-24 02:57:49
Wikitext 语法逐行变动
当前版本新增历史版本移除
- {{Version|长期有效}}{{需要翻译|en=Customizable localization}}
- Customizable localizations were introduced in patch '''[[Patch_1.20|1.20]]'''. They basically allow to add [[Localisation#Commands|bracket commands]] that can be used in localisations to show different text strings dynamically.
- They can be used everywhere, where it's possible to use default [[Localisation#Commands|bracket commands]] as well (e.g. [[Commands#Dual_scope|custom tooltips]] and [[Conditions#List_of_conditions|custom trigger tooltips]], [[Decision_modding#Localisation|decision titles and descriptions]], [[Event_modding|event titles, descriptions and options]], etc.).
+ {{Version|长期有效}}
+ 可定制的本地化(Customizable localizations)被引入于补丁 '''[[Patch_1.20|1.20]]'''。它们基本上允许添加 [[本地化#指令|括号指令]],能被用于本地化以动态地展示不同的文本字符串。
+ 它们能被用在可能使用缺省的 [[本地化#指令|括号指令]](例如:[[指令#多作用域|定制的工具提示]] 和 [[条件#条件列表|自定触发工具提示]],[[决议修改#本地化|决议标题和描述]],[[事件修改|事件标题、描述和选项]],等)的每个地方。
- == Defining a custom bracket command ==
- Custom bracket commands are defined in a file in '''...\customizable_localization'''.
+ == 定义一个定制的括号指令 ==
+ 定制的括号指令(Custom bracket commands)被定义于一个在 '''...\customizable_localization''' 中的文件。
<pre>
defined_text = {
name = GetIfPapalController
text = {
localisation_key = string_is_papal_controller
trigger = {
is_papal_controller = yes
}
}
text = {
localisation_key = string_is_not_papal_controller
trigger = {
is_papal_controller = no
}
}
}
</pre>
- The \"name\" defines the bracket command that can be used in localisations afterwards.
- The \"text\" sections define specific strings that are shown instead of the bracket command in-game, if the triggers are met.
- The \"localisation_key\" defines the string that is shown, if the triggers are met. This key needs to be localized, even if it should contain no characters; otherwise the actual key will be displayed.
+ “name”定义括号指令,之后能被用于本地化。
+ “text”段落定义特定的字符串,其代替括号指令在游戏中展示,如果触发器符合。
+ “localisation_key”定义被展示的字符串,如果触发器符合。这个关键字需要被本地化,哪怕它不包含任何字符;否则将显示实际的关键字。
- === Attriute \"random\" ===
- Customizable localization support the use of the attribute \"random\".
- If the custom bracket command either uses <code>random = yes</code> or it is left out, the game will randomly choose a string of which the triggers are met, if there are more possible strings than one. This means, when defining a custom bracket command this way, the triggers of the different \"text\" sections should exclude each other; similar to multiple ''[[Commands#If.2C_Else_if_and_Else|if]]'' sections, when not using the [[Commands#If.2C_Else_if_and_Else|if-else mechanic]].
+ === “random”属性 ===
+ 可定制的本地化支持使用“random”属性。
+ 如果定制的括号指令使用 <code>random = yes</code> 或者留空,游戏将随机地选择一个符合触发器的字符串,如果有比一个更多的可能的字符串。这意味着,当这样定义一个定制的括号指令,不同“text”段落的触发器应该彼此互斥;类似于多个 ''[[指令#If, Else if 和 Else|if]]'' 段落,而不使用 [[指令#If, Else if 和 Else|if-else 机制]] 时。
- If the custom bracket command uses <code>random = no</code>, the game will always choose the first string of which the triggers are met, even if there are other strings of which the triggers are met. Similar to the [[Commands#If.2C_Else_if_and_Else|if-else mechanic]], this is useful, if there are many strings, because the triggers don't need to be copied every time. It maybe is less performance hungry as well, since it probably doesn't check all triggers, but stops after one trigger is fulfilled.
+ 如果定制的括号指令使用 <code>random = no</code>,游戏将总是选择第一个符合触发器的字符串,即使有其它符合触发器的字符串。类似于 [[指令#If, Else if 和 Else|if-else 机制]],这很有用,如果有很多字符串,因为触发器不需要被复制很多次。它可能也少些性能开销,因为它很可能不检查全部触发器,而停止在一个触发器被满足之后。
<pre>
defined_text = {
name = GetIfPapalController
random = no
text = {
localisation_key = string_is_papal_controller
trigger = {
is_papal_controller = yes
}
}
text = {
localisation_key = string_is_not_papal_controller
trigger = {
always = yes
}
}
}
</pre>
- === Localizing strings ===
- The strings that are defined in the \"text\" sections have to be localized in a localisation file. If that is not done, the game will display the string instead.
- So, if one string is supposed to display nothing at all, it has to be localized as well.
+ === 局部的字符串 ===
+ 定义于“text”段落的字符串必须被本地化在 localisation 文件中。如果没那么做,游戏将显示关键字代替字符串。
+ 这样,如果一个字符串假定要显示完全没东西,它也必须被本地化。
<pre>
l_english:
- string_is_papal_controller: \"Papal Controller\"
- string_is_not_papal_controller: \"not Papal Controller\"
+ string_is_papal_controller: "Papal Controller"
+ string_is_not_papal_controller: "not Papal Controller"
</pre>
- If a string is supposed to display nothing, it can be localized by only using quotation marks:
+ 如果字符串假定要显示没东西,它能只用引号本地化:
<pre>
l_english:
- string_is_papal_controller: \"\"
- string_is_not_papal_controller: \" not\"
+ string_is_papal_controller: ""
+ string_is_not_papal_controller: " not"
</pre>
- == Use in localisation ==
- Custom bracket commands are used the same way as default [[Localisation#Commands|bracket commands]]. Depending on the defined triggers, they support different scopes (e.g. <code>[From.GetIfPapalController]</code>, <code>[Root.GetIfPapalController]</code>). If the triggers are checked globally, for example when checking for global flags, dates, years, ages, months etc., they do not require using a scope, similar to some default [[Localisation#Commands|bracket commands]] (e.g. <code>[GetYear]</code>, <code>[GetMonth]</code>).
+ == 用于本地化 ==
+ 定制的括号指令与缺省的 [[本地化#指令|括号指令]] 相同的方式使用。根据定义的触发器,它们支持不同的作用域(例如:<code>[From.GetIfPapalController]</code>、<code>[Root.GetIfPapalController]</code>)。如果触发器被全局地检查,例如当检查全局标识、日期、年份、年龄、月份等,它们不要求使用作用域,类似于缺省的 [[本地化#指令|括号指令]](例如:<code>[GetYear]</code>、<code>[GetMonth]</code>)。
- For the example given above, this example tooltip would, depending on the situation, display either ''(Name of the country) is Papal Controller'' or ''(Name of the country) is not Papal Controller''.
+ 对于上文给出的例子,其中的工具提示应该,根据情况,显示“''(国名)is Papal Controller''”或者“''(国名)is not Papal Controller''”。
<pre>
l_english:
- example_tooltip: \"[Root.GetName] is [Root.GetIfPapalController].\"
+ example_tooltip: "[Root.GetName] is [Root.GetIfPapalController]."
</pre>
- For the second example given in the \"[[Customizable_localization#Localizing_strings|Localizing strings]]\" section above, it would be used like this:
+ 第二个例子在上文“[[#局部的字符串|局部的字符串]]”段落给出,它应该用作这样:
<pre>
l_english:
- example_tooltip: \"[Root.GetName] is[Root.GetIfPapalController] Papal Controller.\"
+ example_tooltip: "[Root.GetName] is[Root.GetIfPapalController] Papal Controller."
</pre>
{{Modding navbox}}
[[Category:模组制作]]
[[en:Customizable localization]]