Skip to content

Commit

Permalink
LoW: Fix translation error in conjunct list (fixes #2833) (#2834)
Browse files Browse the repository at this point in the history
(cherry picked from commit c086f0c)
  • Loading branch information
CelticMinstrel committed Oct 28, 2018
1 parent 63d0aa3 commit 6150db6
Showing 1 changed file with 21 additions and 51 deletions.
Expand Up @@ -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}
Expand Down

0 comments on commit 6150db6

Please sign in to comment.