wesnoth/data/schema/core/conditionalwml.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

55 lines
1.2 KiB
INI

# All keys here are strings, because there could be variable substitutions
[tag]
name="$conditional_wml"
max=0
{INSERT_TAG}
[tag]
name="true,false"
max=infinite
{INSERT_TAG}
[/tag]
{FILTER_TAG "have_unit" unit (
max=infinite
{INSERT_TAG}
{DEFAULT_KEY search_recall_list string no}
{SIMPLE_KEY count string}
)}
{FILTER_TAG "have_location" location (
max=infinite
{INSERT_TAG}
{SIMPLE_KEY count string}
)}
[tag]
name="variable"
max=infinite
{INSERT_TAG}
{SIMPLE_KEY name string}
{SIMPLE_KEY contains any}
{SIMPLE_KEY equals any}
{SIMPLE_KEY not_equals any}
{SIMPLE_KEY numerical_equals s_int}
{SIMPLE_KEY numerical_not_equals s_int}
{SIMPLE_KEY greater_than s_int}
{SIMPLE_KEY greater_than_equal_to s_int}
{SIMPLE_KEY less_than s_int}
{SIMPLE_KEY less_than_equal_to s_int}
{SIMPLE_KEY boolean_equals s_bool}
{SIMPLE_KEY boolean_not_equals s_bool}
{SIMPLE_KEY formula formula}
[/tag]
[tag]
name="found_item"
max=infinite
{INSERT_TAG}
{REQUIRED_KEY id string}
[/tag]
{EMPTY_TAG "proceed_to_next_scenario" 0 infinite}
{LINK_TAG "lua"}
[tag]
name="and,or,not"
super="$conditional_wml"
[/tag]
any_tag=yes
[/tag]