LoW: Fix translation error in conjunct list (fixes #2833) (#2834)

This commit is contained in:
Celtic Minstrel 2018-04-08 18:55:50 -04:00 committed by GitHub
parent 9805fa8ad0
commit c086f0c47f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -263,57 +263,27 @@ Chapter Three"
[/not]
[/filter]
[/store_unit]
[switch]
variable=l3_store_{NAME}.length
[case]
value=0
[set_variable]
name=left_behind_{NAME}
value= _ "some experienced warriors" # wmllint: ignore
[/set_variable]
[/case]
[case]
value=1
[set_variable]
name=left_behind_{NAME}
value=$l3_store_{NAME}[0].name
[/set_variable]
[/case]
[else]
{VARIABLE l3_length $l3_store_{NAME}.length}
{VARIABLE_OP l3_length sub 1}
[for]
array=l3_store_{NAME}
# for-case, what a great anti-pattern
[do]
[switch]
variable=i
[case]
value=0
[set_variable]
name=left_behind_{NAME}
value=$l3_store_{NAME}[$i].name
[/set_variable]
[/case]
[case]
value=$l3_length
[set_variable]
name=left_behind_{NAME}
value= _ "$left_behind_{NAME} and $l3_store_{NAME}[$i].name" # wmllint: ignore
[/set_variable]
[/case]
[else]
[set_variable]
name=left_behind_{NAME}
value= _ "$left_behind_{NAME}|, $l3_store_{NAME}[$i].name" # wmllint: ignore
[/set_variable]
[/else]
[/switch]
[/do]
[/for]
{CLEAR_VARIABLE l3_length}
[/else]
[/switch]
[lua]
code=<<
local args = (...)
local units = wml.child_array(args, "units")
local empty_str = args.empty
local var = args.variable
for i = 1, #units do
units[i] = units[i].name
end
wml.variables[var] = wesnoth.format_conjunct_list(empty_str, units)
>>
[args]
empty= _ "some experienced warriors" # wmllint: ignore
variable=left_behind_{NAME}
[insert_tag]
name=units
variable=l3_store_{NAME}
[/insert_tag]
[/args]
[/lua]
#enddef
{LEAVE_BEHIND_L3 kalenz 1}