Skip to content

Commit

Permalink
modified: zh/Archive/源码/OpenTTD开发黑皮书/langfile格式
Browse files Browse the repository at this point in the history
  • Loading branch information
tinygrox authored and Librarian committed Dec 16, 2024
1 parent f5409f3 commit 67d9150
Showing 1 changed file with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -142,27 +142,27 @@ langfile 中,每一行就是一个词条。
STR_SORT_BY_DATE
STR_0196_SHOW_LAND_OWNERS_ON_MAP
=== Translations ===
=== 译文 ===

Using curly braces {}, special commands can be inserted into the translations, which are substituted either by strgen or while the string is drawn on the screen. For a full list of commands is available at [[en/Archive/Source/OpenTTDDevBlackBook/Special strings|Special Strings]]. Besides <tt>{STRING'''x'''}</tt> and <tt>{RAW_STRING}</tt> it is recommended to leave those special strings untouched by default. The special commands may substitute values or other strings at where the Special Strings are placed. Translators may have influence on the sequence of these replacements to allow a fluent language.
译文中使用大括号 {},表示插入特殊指令,这些指令会被 strgen 编译时或显示在屏幕上时被替换。For a full list of commands is available at [[en/Archive/Source/OpenTTDDevBlackBook/Special strings|Special Strings]]. Besides <tt>{STRING'''x'''}</tt> and <tt>{RAW_STRING}</tt> it is recommended to leave those special strings untouched by default. The special commands may substitute values or other strings at where the Special Strings are placed. Translators may have influence on the sequence of these replacements to allow a fluent language.

=== Changing word order ===
=== 更改语序 ===

Parameter replacements can be made swappable too. This will allow one parameter that is usually at position 0 (as in : the first one ) in the translated string to be used in fact at position 1, thus swapping place with no 1.

As an example : STR_INDUSTRY_PROD_GOUP.
举个例子: STR_INDUSTRY_PROD_GOUP

In English, the string reads as "{BLACK}{BIGFONT}'''{STRING}''' production at '''{INDUSTRY}''' increases {COMMA}%!"
在英文中,译文为"{BLACK}{BIGFONT}'''{STRING}''' production at '''{INDUSTRY}''' increases {COMMA}%!"

In Finnish, same string is now "{BLACK}{BIGFONT}'''{1:INDUSTRY}''' tuottaa '''{0:STRING}''' {2:COMMA}{NBSP}% entistä enemmän!"
在芬兰文中,译文则变为"{BLACK}{BIGFONT}'''{1:INDUSTRY}''' tuottaa '''{0:STRING}''' {2:COMMA}{NBSP}% entistä enemmän!"

{{en/Todo|Finish and correct this}}

== Cases ==
== ==

After each key, there can be a custom suffix case separated by the period (.). The case must be defined first at the beginning of the file by ##case pragma.
每一个键后面可以加上点(.)然后接格后缀。格必须在文件开头使用预处理指令 ##case 进行定义。

In the following example from the Czech language file, you can see how to define the cases. The Czech language has 7 cases and there is an extra "case" for capitalizing cargo name in the Subsidies dialog.
在下面的捷克语文件中,你将明白如何定义格。捷克语有 7 种格,and there is an extra "case" for capitalizing cargo name in the Subsidies dialog.

##case nom gen dat acc voc loc ins big
Expand Down

0 comments on commit 67d9150

Please sign in to comment.