| Interface | Description |
|---|---|
| Selector |
| Class | Description |
|---|---|
| DefaultNumberRule |
This class handles zero or one rule for each number category.
|
| DualNumberRule |
Number optimized for languages that distinguish the categories one,
two and other.
|
| Messages |
Represents a collection of messages in a particular locale.
|
| Number |
Classes implementing this interface can determine the category and
the index of a double based on the number rules for a language.
|
| NumberRules |
See the
Common Locale Data Repository.
|
| OtherNumberRule |
Number optimized for languages that do not distinguish any number
categories.
|
| PluralNumberRule |
Number optimized for languages that distinguish the categories one
and other.
|
| Relation |
A grammatical relationship.
|
| Rule |
A rule consists of any number of relations combined with "and" and
"or" operators.
|
| TurnSelector |
Support for turn selection.
|
| ZeroOneNumberRule |
Number optimized for languages that place the numbers 0 and 1 in
category one, and all others in category other.
|
| Enum | Description |
|---|---|
| Number.Category |
This package contains the FreeCol support for internationalisation (translation).
The Messages class provides the API to
the translations. Client code might include:
new AbstractAction( Messages.message("cancel") )
..whereupon the Messages class will look for a file called:FreeColMessages[_la[_CO]].properties
..where _la and _CO are the language and country codes from the locale. The most specific file will be loaded. With a US locale, Messages will look for FreeColMessages_en_US.properties first, then FreeColMessages_en.properties and finally FreeColMessages.properties if neither of the other two are found.FreeColMessages.properties contains a line like this:
cancel=Cancel
..while FreeColMessages_hu.properties has a corresponding line:cancel=Mégse
Only FreeColMessages.properties is updated as new messages are added so a tool is required for translators to keep their translations up to date when new messages are added.
At the console, type:
ant compile-test
java -cp src/classes net.sf.freecol.client.gui.i18n.MessageMerge src/net/sf/freecol/client/gui/i18n/FreeColMessages.properties src/net/sf/freecol/client/gui/i18n/FreeColMessages_hu.properties
The screen shot shows "players" and "gameState" messages have been added. Select the added messages from the left and press the [insert in right] button. To remove obselete or over-zealously inserted messages, select a range from the right and press the [delete from right] button. Press the [save right] button to write the changes to the message file shown on the right hand side. Doing so will destroy your translation file without warning so ensure that the file on the right-hand side is committed to CVS before pressing the button or you risk losing your work. |