-
Notifications
You must be signed in to change notification settings - Fork 18
Translations
NOTE: this functionality is present in an unreleased version of ChessCraft (v0.4). It is not available in any current release.
ChessCraft is an internationalised application, in that all message strings which are presented to the user are externalised into message files. New message files can be created on a per-local basis.
Message files can be found in plugins/ChessCraft/lang. To use a particular language, set the locale configuration item to the name of the message file you want to use, without the .yml extension. E.g. to use a file called de_de.yml, set your locale to "de_de" (not case sensitive).
/chess setcfg locale de_de
ChessCraft will then check for a message file plugins/ChessCraft/lang/de_de.yml. If that is not found, it will check for plugins/ChessCraft/lang/de.yml, and if that is not found it will fall back to plugins/ChessCraft/lang/default.yml.
The following languages are currently supported:
- Generic English (default)
The default messages file can be found in ChessCraft's github repository: https://raw.github.com/desht/ChessCraft/master/src/datafiles/lang/default.yml
You can take a copy of this, or if you wish, fork the github repository.
-
The messages file is a YAML file, and is divided into categories (these categories correspond to Java classes used internally by ChessCraft). In a few cases, there are subcategories, e.g.
BoardView.boardDetail
. -
Each entry is a key/value pair. The keys must not be changed, but the values are yours to edit as you wish for the language you are translating to.
-
The values are either simple strings, or a list of strings, for multi-line messages.
-
The values may contain colour control codes, which is an ampersand (&) followed by a hexadecimal digit, 0-9 or a-f. See this Minecraft wiki page for a list of the codes and what colour they map to. The special colour code &- is also used, and restores the colour to the default colour for that message. See also below for colour coding conventions.
-
Some messages include placeholders for variables to be substituted, e.g.
boardDeleted: "Deleted board &6{0}&-."
Placeholders are numbers within curly braces, in this case {0}, which will be substituted with the board name that is being deleted. It should be obvious what the variable is in most cases; if in doubt either look at the source code or ask the author! -
To include single quotes (') in a message, you must use two single quotes (''). This is due to the Java MessageFormat API. E.g.
Can''t delete board &6{0}&- - it is being used by game &6{0}&-.
Translate all the strings in the message file, name your new file after the country & language that you have translated into (note both country and language are significant, to account for dialects, e.g. French as spoken in France - fr_FR - and in Canada - fr_CA).
Then either send the new file to the author (PM on forums.bukkit.org or github.com is OK) or if you've forked the github repository, send a github pull request.
- Feedback messages for commands run or actions taken are AQUA (&b)
- Alert messages from the game (e.g. someone has invited you to a game) are YELLOW (&e)
- Error messages are RED (&4)
- Any message which doesn't fall into the above categories is WHITE (&f)
- Within messages, player and game names should be GOLD (&6)
- Within messages, quoted commands should be WHITE (&f). E.g. in
Type /chess join to join the game
,/chess join
should be white.