wesnoth/data/schema/core/themes.cfg
Celtic Minstrel 0c42cdc038
Enable translation mark validation by the schema (#5800)
- The t_string type is now a schema built-in type and no longer attempts a regex match.
- You can also specify that non-t_string types may be optionally-translatable; this case supports a regex match on the string (but note that the translation mark is not part of the match).
- Error messages involving keys with very large values ( > 128 characters) will now truncate the value.
- To account for occasional cases where the schema is intentionally violated, the --validate command-line option now automatically defines the SCHEMA_VALIDATION preprocessor define.

A key validates as type t_string if one of the following is true:
- The key is not present
- The key has at least one segment with a translation mark
- The key is blank (an empty string)

Any type other than t_string is not allowed to be translatable by default, unless you specify allow_translatable=yes in the [type] tag.

An optionally-translatable string could also be defined as a union of t_string and some other type.
2021-06-14 23:59:52 -04:00

151 lines
3.1 KiB
INI

[tag]
name="theme"
max=infinite
{REQUIRED_KEY id string}
{SIMPLE_KEY name t_string}
{SIMPLE_KEY description t_string}
{DEFAULT_KEY hidden bool no}
[tag]
name="~content~"
[tag]
name="~element~"
{SIMPLE_KEY id string}
{SIMPLE_KEY rect theme_rect}
{SIMPLE_KEY xanchor theme_anchor}
{SIMPLE_KEY yanchor theme_anchor}
{SIMPLE_KEY ref string}
[/tag]
[tag]
name="~control~"
super="theme/~content~/~element~"
{SIMPLE_KEY image string}
{SIMPLE_KEY title t_string}
{SIMPLE_KEY title2 t_string}
{SIMPLE_KEY title_literal string}
{SIMPLE_KEY tooltip t_string}
{SIMPLE_KEY overlay string}
[/tag]
[tag]
name="menu"
max=infinite
{DEFAULT_KEY is_context_menu bool no}
{REQUIRED_KEY items string_list}
[if]
[not]
is_context_menu=yes
[/not]
[then]
super="theme/~content~/~control~"
{DEFAULT_KEY type theme_action image}
{DEFAULT_KEY button bool yes}
{SIMPLE_KEY font_size int}
[/then]
[/if]
[/tag]
[tag]
name="action"
super="theme/~content~/~control~"
max=infinite
{REQUIRED_KEY items string_list}
{DEFAULT_KEY type theme_action image}
{DEFAULT_KEY auto_tooltip bool no}
{DEFAULT_KEY tooltip_name_prepend bool no}
[/tag]
[tag]
name="panel"
super="theme/~content~/~control~"
max=infinite
[/tag]
[tag]
name="slider"
super="theme/~content~/~control~"
max=infinite
{SIMPLE_KEY black_line bool}
[/tag]
[tag]
name="main_map_border"
super="theme/~content~/~element~"
{SIMPLE_KEY border_size real}
{SIMPLE_KEY background_image string}
{SIMPLE_KEY tile_image string}
{DEFAULT_KEY show_border bool yes}
[/tag]
[tag]
name="label"
max=infinite
super="theme/~content~/~element~"
{SIMPLE_KEY text t_string}
{SIMPLE_KEY prefix t_string}
{SIMPLE_KEY postfix t_string}
{SIMPLE_KEY prefix_literal string}
{SIMPLE_KEY postfix_literal string}
{SIMPLE_KEY icon string}
{SIMPLE_KEY font_size int}
{SIMPLE_KEY font_rgb color}
[/tag]
[tag]
name="no_battery"
super="theme/~modification~"
[/tag]
[tag]
name="replay"
super="theme/~modification~"
[/tag]
[tag]
name="status"
[tag]
name="*"
super="theme/resolution/label"
{SIMPLE_KEY font_size int}
{SIMPLE_KEY prefix t_string}
{SIMPLE_KEY postfix t_string}
{SIMPLE_KEY prefix_literal string}
{SIMPLE_KEY postfix_literal string}
[/tag]
[/tag]
[tag]
name="*"
super="theme/~content~/~element~"
[/tag]
[/tag]
[tag]
name="~modification~"
[tag]
name="change"
super="theme/~content~/~element~"
max=infinite
{ANY_KEY string}
[/tag]
[tag]
name="remove"
max=infinite
{REQUIRED_KEY id string}
[/tag]
[tag]
name="add"
max=infinite
super="theme/~content~"
max_tags=1
[/tag]
[/tag]
[tag]
name="resolution"
min=1
max=infinite
super="theme/~content~"
{REQUIRED_KEY id resolution}
{REQUIRED_KEY width int}
{REQUIRED_KEY height int}
[/tag]
[tag]
name="partialresolution"
max=infinite
super="theme/~modification~"
{REQUIRED_KEY id resolution}
{REQUIRED_KEY inherits resolution}
{REQUIRED_KEY width int}
{REQUIRED_KEY height int}
[/tag]
[/tag]