本地化

本頁面所適用的版本可能已經過時,最後更新於1.4

本地化文件位於localization文件夾中。

與大多數其他文件不同,本地化文件具有.yml擴展名。

所有文件名稱類似於:<某一事項>_l_<語言>.yml

文件格式是有BOM的UTF-8。

文本格式化以字符#開始,字符#!結束。

#<格式化代码> <文本> #!

例如:
#P +15%#!

插入其他本地化鍵值:$<其他鍵值>$(例如$special_contract_march_short$)

舉例:

l_english:
 innovation_motte:0 "Mottes"
 innovation_motte_desc:0 "Simple yet effective, building our castles on raised earthen mounds is the best way to ensure we quite literally have the high ground over our enemies."
 unlock_tribal_economic_buildings:0 "Unlocks all Tribal Era [economic_buildings|E]"
 unlock_tribal_military_buildings:0 "Unlocks all Tribal Era [military_buildings|E]"
 unlock_march_contract:0 "Unlocks the #high $special_contract_march_short$#! [feudal_contract|E]"

指令[編輯 | 編輯原始碼]

指令必須用於本地化是動態並且基於某些條件而改變的實例。調用一個指令將顯示特定文本字符串。

性別[編輯 | 編輯原始碼]

這些指令將顯示根據作用域中角色的性別而變化的文本。

指令
GetHerHim
GetHerHis
GetHerHisMy
GetHersHis
GetHerselfHimself
GetLadyLord
GetSheHe

角色名稱[編輯 | 編輯原始碼]

這些指令將顯示角色名稱的某些變體。此列表不完整。

指令
GetFirstName
GetFirstNameBase
GetFirstNameNicknamed
GetFirstNameNicknamedNoTooltip
GetFirstNameNicknamedNoTooltipRegnal
GetFirstNameNicknamedOrMe
GetFirstNameNicknamedOrMeNoTooltip
GetFirstNameNicknamedOrMeNoTooltipRegnal
GetFirstNameNicknamedOrMeRegnal
GetFirstNameNicknamedPossessive
GetFirstNameNicknamedPossessiveNoTooltip
GetFirstNameNicknamedPossessiveNoTooltipRegnal
GetFirstNameNicknamedPossessiveOrMy
GetFirstNameNicknamedPossessiveOrMyNoTooltip
GetFirstNameNicknamedPossessiveOrMyNoTooltipRegnal
GetFirstNameNicknamedPossessiveOrMyRegnal
GetFirstNameNicknamedPossessiveRegnal
GetFirstNameNicknamedRegnal
GetFirstNameNoTooltip
GetFirstNameNoTooltipRegnal
GetFirstNameOrMe
GetFirstNameOrMeNoTooltip
GetFirstNameOrMeNoTooltipRegnal
GetFirstNameOrMeRegnal
GetFirstNamePossessive
GetFirstNamePossessiveNoTooltip
GetFirstNamePossessiveNoTooltipRegnal
GetFirstNamePossessiveOrMy
GetFirstNamePossessiveOrMyNoTooltip
GetFirstNamePossessiveOrMyNoTooltipRegnal
GetFirstNamePossessiveOrMyRegnal
GetFirstNamePossessiveRegnal
GetFirstNameRegnal
GetFullName
GetFullNameNicknamed
GetFullNameNicknamedNoTooltip
GetFullNameNicknamedNoTooltipRegnal
GetFullNameNicknamedOrMe
GetFullNameNicknamedOrMeNoTooltip
GetFullNameNicknamedOrMeNoTooltipRegnal
GetFullNameNicknamedOrMeRegnal
GetFullNameNicknamedPossessive
GetFullNameNicknamedPossessiveNoTooltip
GetFullNameNicknamedPossessiveNoTooltipRegnal
GetFullNameNicknamedPossessiveOrMy
GetFullNameNicknamedPossessiveOrMyNoTooltip
GetFullNameNicknamedPossessiveOrMyNoTooltipRegnal
GetFullNameNicknamedPossessiveOrMyRegnal
GetFullNameNicknamedPossessiveRegnal
GetFullNameNicknamedRegnal
GetFullNameNoTooltip
GetFullNameNoTooltipRegnal
GetFullNameOrMe
GetFullNameOrMeNoTooltip
GetFullNameOrMeNoTooltipRegnal
GetFullNameOrMeRegnal
GetFullNamePossessive
GetFullNamePossessiveNoTooltip
GetFullNamePossessiveNoTooltipRegnal
GetFullNamePossessiveOrMy
GetFullNamePossessiveOrMyNoTooltip
GetFullNamePossessiveOrMyNoTooltipRegnal
GetFullNamePossessiveOrMyRegnal
GetFullNamePossessiveRegnal
GetFullNameRegnal
GetName
GetNameNicknamed
GetNameNicknamedNoTooltip
GetNameNicknamedNoTooltipRegnal
GetNameNicknamedOrMe
GetNameNicknamedOrMeNoTooltip
GetNameNicknamedOrMeNoTooltipRegnal
GetNameNicknamedOrMeRegnal
GetNameNicknamedPossessive
GetNameNicknamedPossessiveNoTooltip
GetNameNicknamedPossessiveNoTooltipRegnal
GetNameNicknamedPossessiveOrMy
GetNameNicknamedPossessiveOrMyNoTooltip
GetNameNicknamedPossessiveOrMyNoTooltipRegnal
GetNameNicknamedPossessiveOrMyRegnal
GetNameNicknamedPossessiveRegnal
GetNameNicknamedRegnal
GetNameNoTooltip
GetNameNoTooltipRegnal
GetNameOrMe
GetNameOrMeNoTooltip
GetNameOrMeNoTooltipRegnal
GetNameOrMeRegnal
GetNamePossessive
GetNamePossessiveNoTooltip
GetNamePossessiveNoTooltipRegnal
GetNamePossessiveOrMy
GetNamePossessiveOrMyNoTooltip
GetNamePossessiveOrMyNoTooltipRegnal
GetNamePossessiveOrMyRegnal
GetNamePossessiveRegnal
GetNameRegnal

特殊字符[編輯 | 編輯原始碼]

一些字符集執行特殊功能。

指令 描述 示例
\n 換行。僅在某些情況下有效。
#P Formats text "positive"
#P A very good thing has happened#!
OR
[GetFullName|P]
#N Formats text "negative"
#N A rather bad thing has happened#!
OR
[GetFullName|N]
#help Text is shown using a help style
#help If you do not give either Gold or Soldiers to the war effort, your [head_of_faith|E] will condemn you and you will lose [piety|E].#!
#I Text is displayed in an informational style
#I Click to view your [GetPlayer.GetCouncillorPosition( 'councillor_court_chaplain' ).GetPositionName]#!
#W 文本顯示為警告
#W Only your younger children lacks [guardians|E]#!
#T 文本顯示為標題
#T Randomize Dynasty Name#!
#E 文字顯示為遊戲概念
#E Randomize#!
#X Text is displayed as a warning in italic format
#X Choosing a New Appearance will discard ALL previous changes!#!
#S Formats text bold and italic
#S Occupying Counties:#!
#V Formats text white
#V This text is white #!
OR
[GetFullName|V]
#U 將文本轉換為大寫
[TITLE.GetName|U]
#L 將文本轉換為小寫
[TITLE.GetName|L]
#EMP 文本被強調
#EMP Emphasis here #!
#weak Text has a lighter color
#weak footnote or aside #!
#bold 文本以粗體顯示
You have #bold NOT #! done this
#italic 文本以斜體顯示
You #weak will #! do this

連結[編輯 | 編輯原始碼]

本地化字符串可以連結到遊戲概念,如下所示:

[concept_key|E]

# So for example
[faith|E]

默認情況下,概念以大寫的第一個字母開頭,您可以將第一個字母設置為小寫,如下所示:

[concept_key|El]

# So for example
"The word [faith|El] is now starting by a lower case letter"

連結到遊戲概念的表達式可以自定義,如下:

[Concept('concept_key','Customized expression')|E]

# So for example
"The game concept link [Concept('faith','religion')|E] is now written as religion."

捨入數[編輯 | 編輯原始碼]

如果數值有小數部分,則可以根據所需的小數位數對其進行捨入,例如:

# Round to 2 decimals
[some_value|2]

# Remove all decimals:
[some_value|0]

請注意,該值總是向下捨入。

參考資料[編輯 | 編輯原始碼]