Difference between revisions of "LanguageWML"

From The Battle for Wesnoth Wiki
 
Line 75: Line 75:
 
* [[ReferenceWML]]
 
* [[ReferenceWML]]
  
 +
 +
[[Category: WML Reference]]

Revision as of 11:29, 20 January 2006

the toplevel [language] tag

Each [language] tag represents one language. Languages are selected by pressing the "Language" button in-game.

If you are just trying to make a language, then open the file data/sample-translation.cfg, then translate all the pink text into another language (See WesnothTranslations for information on how to submit your translation). The purpose of this wiki, however, is to explain how the internationalization system works. (Note: this wiki is currently incomplete)

the Wesnoth internationalization system

In the Wesnoth internationanization system, each tag that has keys with displayed text values is given an internationalization key, or an ID. For example, the [scenario] tag has the key name which is a text value, and this value is displayed in the game. So each [scenario] tag is given an ID, which is used to translate this text in different languages. Most internationalized tags have the key id//; the value of id is the tag's ID. However, the tag [unit] (see UnitWML) uses the key name in place of id. Important: since keys are not allowed to have spaces, all spaces should be removed when entering a key. However, several IDs use underbars instead of spaces; underbars should not be removed.


Internationalization attributes

One type of internationalization attribute is the attribute id//=//translation. This attribute is interpreted as meaning that all tags with ID id should have their main text interpreted as translation. For example, the attribute Elves_Besieged="Elves Besieged"|| means that the scenario with ||id=Elves_Besieged should use the name "Elves Besieged" in the translation.

However, some internationalized tags have multiple text attributes. An example is [scenario], which has the name of the scenario, and the scenario objectives. If the key key is not the main text of its tag, it is interpreted using the attribute == id//_//key//=//translation ==. For example the key Crossroads_objectives describes the scenario objectives for Crossroads.

A list of tags which have IDs:

  • [campaign] main text: name//. Also, difficulty_descriptions//, which is written as difficulties. See CampaignWML
  • [scenario] main text: name//. Also, objectives. See ScenarioWML
  • [unit] main text: name//. Also, description. See UnitWML
  • [message] main text: message. See [message], InterfaceActionsWML
  • [object] main text: message. See [object], DirectActionsWML
  • [terrain] main text: name. See TerrainWML

Another type of internationalization attribute: type//_//specific//=//translation. type is a type of text; specific is which text. For example the attribute ability_cures="cures" would translate the ability "cures" as "cures".

The following are values for type:

  • "ability" specific is the name of an ability (See AbilitiesWML).

The translation will be displayed on the Status Table.

  • "action" specific is a UI action, for example "Recruit".

The translation will be displayed as an option on a menu. See ThemeWML for a list of UI actions, and for information on menus.

  • "weapon_name" specific is the name of a unit's weapon.

All weapons with name=specific// (see AttackWML) will be displayed on the Status Table as translation.

  • "weapon_special" a weapon specialty, displayed in the Status Table under the weapon's name. See AbilitiesWML

Another type: tooltip//_description=//translation. Whenever the player's cursor is over the word tooltip//, translation will be displayed as a tooltip.

The following types of text can have tooltips:

In addition to internationalization attributes, the following keys are recognized:

  • language the name of the language (in the language).

This is displayed when selecting a translation.

  • id the internationalization key of the language

See Also