Make templates localizable (Closes #100)

This commit is contained in:
Twan van Laarhoven
2020-10-03 14:38:39 +02:00
parent f2ae3ae43b
commit c7377303cf
23 changed files with 155 additions and 63 deletions
+2 -2
View File
@@ -27,7 +27,7 @@ Fields are part of the [[file:style triangle]]:
* @color@
* @info@
| @name@ [[type:string]] ''required'' Name of the field.
| @description@ [[type:string]] @""@ Description of the field, shown in the status bar when the mouse is over the field.
| @description@ [[type:localized string]] @""@ Description of the field, shown in the status bar when the mouse is over the field.
| @icon@ [[type:filename]] Filename of an icon for this field, used for automatically generated [[type:statistics category]]s.
| @editable@ [[type:boolean]] @true@ Can values of this field be edited?
| @save value@ [[type:boolean]] @true@ Should values of this field be saved to files? Should be disabled for values that are generated by scripts.
@@ -38,7 +38,7 @@ Fields are part of the [[file:style triangle]]:
| @card list width@ [[type:int]] @100@ Width of the card list column in pixels.
| @card list visible@ [[type:boolean]] @false@ Should this field be shown in the card list by default?
| @card list allow@ [[type:boolean]] @true@ Should this field be allowed in the card list at all?
| @card list name@ [[type:string]] field name Alternate name to use for the card list, for example an abbreviation.
| @card list name@ [[type:localized string]] field name Alternate name to use for the card list, for example an abbreviation.
| @card list alignment@ [[type:alignment]] @left@ Alignment of the card list column.
| @sort script@ [[type:script]] Alternate way to sort the card list when using this column to sort the list.
+8 -4
View File
@@ -14,18 +14,19 @@ The menu consists of a number of entries, either items, separators or submenus.
* @line@, a separating line.
* @submenu@, a submenu.
| @name@ [[type:string]] ''required'' Name of this menu item, corresponding to the code to insert.
| @label@ [[type:localized string]] name Label to show in the menu.
| @prompt@ [[type:localized string]] Prompt to use for the pop up box with @custom@ type
| @items@ [[type:list]] of [[type:insert symbol menu|submenu items]] Items in the submenu, when items are present the @type@ is set to @"submenu"@.
In the user interface the items are shown as @"menu item {name}"@, the [[type:locale]] should be used to give a beter label.
For custom items the dialog will be titled @"title {name}"@ and have message text @"message {name}"@, again this should be changed in the locale.
For custom items the dialog will be titled with the @label@ and have message text @prompt@.
--Examples--
A menu for magic mana symbols (simplified). Containing all types of items.
>insert symbol menu:
> item:
> type: custom
> name: colorless
> name: Generic
> prompt: How much generic mana?
> item:
> type: line
> item: W
@@ -34,6 +35,9 @@ A menu for magic mana symbols (simplified). Containing all types of items.
> item: R
> item: G
> item:
> label: Complex
> name: cplx
> item:
> type: line
> item:
> name: hybrid
+3
View File
@@ -35,12 +35,15 @@ There are usually no other files in the package.
| @error@ [[type:map]] of [[type:string]]s Error messages.
| @type@ [[type:map]] of [[type:string]]s Types of objects for error messages.
| @game@ [[type:map]] of [[type:map]] of [[type:string]]s
Deprecated since MSE 2.1.3, use @localized_...@ instead.<br/>
Translations for specific [[type:game]]s.<br/>
Field names and field descriptions are looked up in the locale, if they are found the translation is used, otherwise the value from the game file.<br/>
Extra keys not present in the English locale can be added here.
| @stylesheet@ [[type:map]] of [[type:map]] of [[type:string]]s
Deprecated since MSE 2.1.3, use @localized_...@ instead.<br/>
Translations for specific [[type:stylesheet]]s.
| @symbol font@ [[type:map]] of [[type:map]] of [[type:string]]s
Deprecated since MSE 2.1.3, use @localized_...@ instead.<br/>
Translations for specific [[type:symbol font]]s, in particular the "insert symbol" menu.
Some of the items can contain placeholders for other values, for example:
+14
View File
@@ -0,0 +1,14 @@
Localized strings
A 'localized string' is a [[type:map]] of [[type::string]]s, indexed by locale name.
It is used to translate games and stylesheets to other user interface languages.
Localized strings can be given with a @localized@ prefix on the property name.
For example, a field has a @description@ which is a [[type::string]], and a @localized_description@ for localized variants. So
>field:
> name: cost
> description: How much this card costs
> localized description:
> en_US: How much this card costs
> nl_NL: Hoeveel deze kaart kost
+1 -1
View File
@@ -12,7 +12,7 @@ Statistics dimensions are automatically generated for all [[type:statistics dime
--Properties--
! Property Type Default Description
| @name@ [[type:string]] ''required'' Name of this category.
| @description@ [[type:string]] @""@ A description of the category, currently not used.
| @description@ [[type:localized string]] @""@ A description of the category, currently not used.
| @position hint@ [[type:string]] @0@ Hint for ordering category, lower numbers are at the top of the list.
| @icon@ [[type:filename]] Filename of an icon for this category, the image should be 21x21 pixels.
| @type@ [[type:graph type]] @"bar"@ Type of graph to use.
+1 -1
View File
@@ -13,7 +13,7 @@ Categories are also automatically generated from dimensions.
--Properties--
! Property Type Default Description
| @name@ [[type:string]] ''required'' Name of this dimension, used as an axis label and a label for automatically generated categories.
| @description@ [[type:string]] @""@ A description of the dimension, currently not used.
| @description@ [[type:localized string]] @""@ A description of the dimension, currently not used.
| @position hint@ [[type:string]] @0@ Hint for ordering dimensions.
| @icon@ [[type:filename]] Filename of an icon for this dimension.
| @script@ [[type:script]] ''required'' Script that generates a value for each card in the set.