Translations

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-locale basis.

Setting your language

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" (it's 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.

Supported languages

The following languages are currently supported (use the Locale String as the value for /chess set locale <value> - case insensitive):

LanguageCountryLocale StringVersionUp to Date?
Chinese (Simplified)Chinazh_CN1.3.2no
Generic Englishn/adefault1.4.0yes
GermanGermanyde_DE1.3.2no
PortugeseBrazilpt_BR1.3.2no
PortugesePortugalpt_PT2.0.0yes
RussianRussiaru_RU1.0.3no
SpanishSpaines_ES0.4.1no

The Version field shows the latest version of ChessCraft that the translation has messages for. If Up to Date? is 'no', then some messages may be displayed untranslated (i.e. in English). A Version field of development means the translation is in the latest code version, but not yet in a released version.

How to make a new translation

The default messages file can be found in ChessCraft's github repository: https://raw.github.com/desht/ChessCraft/master/src/main/resources/datafiles/lang/default.yml

You can take a copy of this, or (recommended) 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.
  • IMPORTANT: All translations are in UTF-8 encoding. Any new message file you create must also be UTF-8 encoded or CraftBukkit will be unable to load it.
  • 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 which uses placeholders, 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).

You can test your translations by copying your new file into plugins/ChessCraft/lang, then typing /chess set locale <your-locale> in-game. All messages (and all control panel sign text) should now appear in your language.

For inclusion in the next ChessCraft release, either send the new file to me via a ticket here on dev.bukkit.org, or PM me (desht) on forums.bukkit.org or dev.bukkit.org. Or, if you've forked the github repository, send a github pull request!

You should also be prepared to maintain your messages file. I will attempt to contact any known translators before any release which includes new messages so updated translations can be included, but it's also worth keeping track of ChessCraft development on the github page. If a translation file does fall out of date, any missing translations will just be displayed in the default (English) locale.

Special Considerations

  • The messages in category SMSIntegrations are labels that go on signs. As such, they need to be at most 15 characters long, including colour codes. Note: as of ScrollingMenuSign 1.3.0, you can also create multisign views, which can stretch menu items across several signs horizontally.
  • Similarly for the messages in category ControlPanel, but in this case the message may be split over 2 lines with a ";" character. (ChessCraft 0.4.1+ is needed for the message to be correctly split).

Colour coding conventions

  • 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

Comments

Posts Quoted:
Reply
Clear All Quotes