Difference between revisions of "TranslationsWML"
From The Battle for Wesnoth Wiki
(documentation for textdomain syntax and tags) |
(Categorize) |
||
Line 45: | Line 45: | ||
path="data/campaigns/Liberty/translations" | path="data/campaigns/Liberty/translations" | ||
[/textdomain] | [/textdomain] | ||
+ | |||
+ | [[Category:WML Reference]] |
Revision as of 11:29, 8 March 2008
This page describes tags and syntax used for enabling translation in your user made campaign.
_ "<translatable string>"
Any string that you want to be translated has to be put inside _ " ". Example:
[message] speaker=narrator message= _ "This string is going to be translated." [/message]
#textdomain <textdomain>
This comment tells Wesnoth to use a certain textdomain. Affects the tag that it has been placed in and all children until another #textdomain is found. A textdomain is a set of translations(you can create your own one for your campaign). Example:
#textdomain wesnoth-trow [event] #textdomain wesnoth-httt [message] message= _ "heir to the throne message" #this will be translated using the HttT textdomain [/message] [message] message= _ "heir to the throne message two" #same as above [/message] #textdomain wesnoth-utbs [message] message= _ "under the burning suns message" #UtbS textdomain [/message] [/event] [event] [message] message= _ "the rise of wesnoth message" #TroW textdomain [/message] [/event]
Note: The [scenario] tag isn't a child of [campaign], so you will have to specify a textdomain for both, your campaign and each of your scenarios.
the [textdomain] tag
This tag, which has to be placed at the same level as [campaign], is used to specify a path for your own textdomain.
Example:
[textdomain] name="wesnoth-Liberty" path="data/campaigns/Liberty/translations" [/textdomain]