* reorganize card db, add doit file * make card_db_src a true source by removing untranslated entries, removing the untranslated field * turn update language script into a better compiler * move tools into submodule * remove language db comparison test; add travis compile and check-in of card db Co-authored-by: Nick Vance <nickv2002@users.noreply.github.com>
8.4 KiB
Translation Instructions
File Format
/card_db/
xx/
bonuses_xx.json
cards_xx.json
sets_xx.json
types_xx.json
where xx is ISO 639-1 standard language code in lower case with under bar '_' replacing dash '-' Please rename the directory and the files to match the language you are providing.
Character encoding
The files:
bonuses_xx.json
cards_xx.json
sets_xx.json
types_xx.json
must be encoded in ISO 8859-15, also known as "Latin alphabet no. 9" This character set is used throughout the Americas, Western Europe, Oceania, and much of Africa. It is also commonly used in most standard romanizations of East-Asian languages.
If you have a language that is not supported by ISO 8859-15 please contact the developers by creating a new issue.
Anatomy of sets_xx.json
Entries in this file represent Dominion sets/expansions. A typical entry looks like:
"alchemy": {
"set_name": "Alchimia",
"text_icon": "Al"
},
- The set key word (e.g.,
alchemyfor the above entry) MUST NOT BE CHANGED. This value is used to identify the translation entry. - The key word
set_nameMUST NOT BE CHANGED, but the value after the:should be changed to the name of the set in the target language. - The key word
text_iconMUST NOT BE CHANGED, but the value after the:should be a one or two letter identifier to be used by the set if the set graphics are not displayed. This is usually the first letter of the set name in the target language. - Do not change any punctuation outside of the quotes
". For example, brackets{or}, colons:, quotes"or commas,.
Anatomy of bonuses_xx.json
Entries in this file represent Dominion bonuses. A typical entry looks like:
"exclude": [
"token",
"Tokens"
],
"include": [
"Coins",
"Coin",
"Cards",
"Card",
"Buys",
"Buy",
"Actions",
"Action",
"<VP>"
]
The items in the include list are items that will be marked bold (i.e., <b>..</b>)
when found in the card text in the following format:
+# item_from_include_list
as long as this is not followed by a item from the exclude list.
For example in English:
+2 Buys will be made bold, but
+1 Action token will not, since the key word token follows.
- Just replace the English terms with the terms used in the target language.
- Generally you should include the singular as well as the plural version of the term.
- English versions do not need to be duplicated, since they are used automatically.
- The key words
excludeandincludeMUST NOT BE CHANGED. - Do not change any punctuation outside of the quotes
". For example, brackets{or}, colons:, quotes"or commas,.
Anatomy of types_xx.json
Entries in this file represent Dominion card types. A typical entry looks like:
"Action": "Action in new language",
- The type key word (i.e., the
Actionfor the above entry) MUST NOT BE CHANGED. This value is used to identify the translation entry. - Do not change any punctuation outside of the quotes
". For example, brackets{or}, colons:, quotes"or commas,.
Anatomy of cards_xx.json
Entries in this file represent Dominion cards, and groups of cards. A typical entry looks like:
"Gold": {
"description": "Worth 3 Coins.",
"extra": "30 cards per game.",
"name": "Gold",
"untranslated" : "description, extra, name"
},
-
The card key word (e.g.,
Goldfor the above entry) MUST NOT BE CHANGED. This value is used to identify the translation entry. -
The key word
nameMUST NOT BE CHANGED, but the value after the:should be changed to the name of the card in the target language. -
The key word
descriptionMUST NOT BE CHANGED, but the value after the:should be changed to the card text in the target language. -
The key word
extraMUST NOT BE CHANGED, but the value after the:should be changed to any extra rules or explanations for the card in the target language. If you purposely want no extra text, enter"". -
The key word
untranslatedMUST NOT BE CHANGED, but the value after the:should be changed. Removed any key word for which you have provided a translation. For example: -
if you provided the
nameof the card, and only thename, then change todescription, extra -
if you provided the
nameof the card and it'sdescription, but have not translated theextra, then change toextra -
if you provided all 3 entries, then change to
""
The "untranslated" entry is used during maintanance of the language files to update any remaining default language entries that might have changed.
Special Text
These character sequences have special meaning in the "description" and "extra" text:
<b>...</b>for bold<i>...</i>for italics<u>...</u>for underline<tab>and<t>and\tto add a tab (4 spaces)<n>and\nfor a "hard new line"<br>and<br/>and<br />for a "soft new line"<c>and<center>add hard new line and center text until the next hard new line<l>and<left>add hard new line and left align text until the next hard new line<r>and<right>add hard new line and right align text until the next hard new line<j>and<justify>add hard new line and justify align text until the next hard new line<line>to add a hard new line, a centered dividing line, and a trailing hard new line
Hard new lines (\n and <n>), will reset the paragraph formatting back to the default.
Soft new lines will insert a new line, but will continue the current formatting.
The description will be default to "center" text.
The extra will default to "justify" text.
Special Images
Special character sequences are recognized by the program to substitute graphics in the text. These include:
<VP>andVPfor a Victory Point graphicPotionfor a small Potion graphic# Coinwhere # is a number 0 - 13, a question mark?,_, or the lettersemptyfor a small coin graphic with the # on top# Coinswhere # is a number 0 - 13, a question mark?,_, or the lettersemptyfor a small coin graphic with the # on top# coinwhere # is a number 0 - 13, a question mark?,_, or the lettersemptyfor a small coin graphic with the # on top# coinswhere # is a number 0 - 13, a question mark?,_, or the lettersemptyfor a small coin graphic with the # on top# Debtwhere # is a number 0 - 13, for a small debt graphic with the # on top# <*COIN*>where # is a number 0 - 13, will produce a large coin graphic with the # on top# <*VP*>where # is a number, will produce a large Victory Point graphic with the # before it# <*POTION*>where # is a number, will produce a large Potion graphic with the # before it
For example:
- the text
1 coinwould produce a graphic of a coin with the number 1 on top. - the text
empty coinand_ coinwould produce a graphic of only a coin.
IMPORTANT: To keep the special images, please do not translate any of the above Special character sequences into the target language.
Style Guide
-
If bonuses_xx.json for the target language is configured correctly, bonuses within the text will automatically be bolded. In English, it will not bold the text if it is followed by
tokenorToken. Example:Choose one: +3 Cards; or +2 Actions.will bold+3 Cardsand+2 Actions. -
Bonuses should be listed in the following order:
+ Cards,+ Actions,+ Buys,+ Coins,+ <VP>
-
When possible, bonuses should be listed vertically and centered. Examples:
+1 Card<br>+1 Action<br>+1 Buy<br>+1 Coin<br>+2 <VP><n>+1 Card\n+1 Action\n+1 Buy\n+1 Coin\n+2 <VP>\n
The
descriptionfield by default is centered.<br>,<n>, and\nwill all provide new lines. -
If a Dividers/Tab has more than one card explanation, if space permits, try to mimic a stand alone Dividers/Tab in the overall format. Example from "Settlers - Bustling Village":
<left><u>Settlers</u>:<n>+1 Card<br>+1 Action<n>Look through your discard pile. You may reveal a Copper from it and put it into your hand.<n> <left><u>Bustling Village</u>:<n><center>+1 Card<br>+3 Actions<n> Look through your discard pile. You may reveal a Settlers from it and put it into your hand.