wc: Fix mapgen-related strings being in the wrong textdomain

The _ locals are there to ensure that if _ is overridden anywhere else
in the enclosing scope (which I haven't properly determined *where* it
is yet) it gets overridden again with the right textdomain object.
It *does* tell wmlxgettext what the correct textdomain is without using
the `-- #textdomain` hack anyway, so might as well just do it this way
regardless of the global-looking _ in map/main.lua.

CC #5311
This commit is contained in:
Iris Morelle 2021-03-12 19:34:32 -03:00
parent edef0c5f33
commit 2de931cfa0
24 changed files with 40 additions and 7 deletions

View file

@ -1,4 +1,4 @@
_ = wesnoth.textdomain "wesnoth"
_ = wesnoth.textdomain 'wesnoth-wc'
helper = wesnoth.require("helper")
utils = wesnoth.require("wml-utils")
functional = wesnoth.require("functional")

View file

@ -140,6 +140,8 @@ function wct_store_possible_encampment_ford()
))
end
local _ = wesnoth.textdomain 'wesnoth-wc'
return function()
set_map_name(_"Start")

View file

@ -177,6 +177,7 @@ function wct_map_2a_post_bunus_decoration()
wct_noise_snow_to("Wwf")
end
local _ = wesnoth.textdomain 'wesnoth-wc'
return function()
set_map_name(_"water^Springs")

View file

@ -242,6 +242,8 @@ function world_conquest_tek_map_constructor_lakes()
}
end
local _ = wesnoth.textdomain 'wesnoth-wc'
return function()
set_map_name(_"Lakes")
world_conquest_tek_map_constructor_lakes()

View file

@ -202,6 +202,8 @@ function world_conquest_tek_map_decoration_2c()
wct_change_map_water("g")
end
local _ = wesnoth.textdomain 'wesnoth-wc'
return function()
set_map_name(_"Glaciers")
world_conquest_tek_map_noise_classic("Gs^Fp")

View file

@ -159,6 +159,7 @@ function wct_map_2d_post_bunus_decoration()
wct_noise_snow_to("Gd")
end
local _ = wesnoth.textdomain 'wesnoth-wc'
return function()
set_map_name(_"Provinces")

View file

@ -121,7 +121,7 @@ function world_conquest_tek_map_repaint_2e()
end
function wct_map_yard(directions, counter_directions)
-- todo: is this code 'symmetric' andin the sense that switching
-- todo: is this code 'symmetric' andin the sense that switching
-- directions and counter_directions doesn't change anythign at all?
local terrain_to_change = map:get_locations(f.all(
f.terrain("Gg"),
@ -215,6 +215,7 @@ function wct_map_decoration_3e_leantos()
end
end
local _ = wesnoth.textdomain 'wesnoth-wc'
return function()
set_map_name(_"Paradise")

View file

@ -121,6 +121,7 @@ function wct_map_2f_post_bunus_decoration()
}
end
local _ = wesnoth.textdomain 'wesnoth-wc'
return function()
set_map_name(_"Clayey")

View file

@ -169,6 +169,7 @@ function world_conquest_tek_castle_swamp_bridges()
wct_castle_swamp_bridge("Bw\\", "se,nw", "!,Ds,S*,*^B*,Xu,Q*,M*^*,W*,Ch*,Kh*")
end
local _ = wesnoth.textdomain 'wesnoth-wc'
return function()
set_map_name(_"Savannah")

View file

@ -71,6 +71,7 @@ function wct_hunging_bridge(bridge, directions)
}
end
local _ = wesnoth.textdomain 'wesnoth-wc'
return function()
set_map_name(_"civilization^Wreck")

View file

@ -390,6 +390,7 @@ function wct_map_3c_post_bunus_decoration()
}
end
local _ = wesnoth.textdomain 'wesnoth-wc'
return function()
set_map_name(_"river^Delta")

View file

@ -56,6 +56,7 @@ function world_conquest_tek_map_repaint_3d()
wct_dirt_beachs("7..10")
end
local _ = wesnoth.textdomain 'wesnoth-wc'
return function()
set_map_name(_"Sulfurous")

View file

@ -73,6 +73,7 @@ function wct_map_3e_post_bunus_decoration()
end
local _ = wesnoth.textdomain 'wesnoth-wc'
return function()
set_map_name(_"made of^Coral")

View file

@ -246,6 +246,7 @@ function wct_store_cave_passages_candidates()
end
local _ = wesnoth.textdomain 'wesnoth-wc'
return function()
set_map_name(_"Wetland")

View file

@ -195,6 +195,8 @@ function wct_map_4a_post_bunus_decoration()
wct_noise_snow_to("Gd")
end
local _ = wesnoth.textdomain 'wesnoth-wc'
return function()
set_map_name(_"Thermal")
world_conquest_tek_map_noise_classic("Gs^Fp")

View file

@ -410,6 +410,8 @@ function world_conquest_tek_map_repaint_4b()
end
local _ = wesnoth.textdomain 'wesnoth-wc'
return function()
set_map_name(_"Volcanic")
world_conquest_tek_map_noise_classic("Gs^Fp")

View file

@ -282,6 +282,8 @@ function wct_map_4c_post_bunus_decoration()
wct_noise_snow_to("Rb")
end
local _ = wesnoth.textdomain 'wesnoth-wc'
return function()
set_map_name(_"Mines")
world_conquest_tek_map_noise_classic("Gs^Fp")

View file

@ -129,6 +129,7 @@ local function wct_map_4d_post_bunus_decoration()
wct_map_cave_path_to("Re")
end
local _ = wesnoth.textdomain 'wesnoth-wc'
return function()
set_map_name(_"Podzol")

View file

@ -638,6 +638,7 @@ function wct_map_4e_post_bunus_decoration()
end
local _ = wesnoth.textdomain 'wesnoth-wc'
return function()
set_map_name(_"Wicked")

View file

@ -262,6 +262,8 @@ function wild_store_roads_in_cave_zone(map_data)
map_data.road_in_cave = map:get_locations(f.terrain("R*,Ur"), map_data.road_in_cave)
end
local _ = wesnoth.textdomain 'wesnoth-wc'
return function()
set_map_name(_"Wild")
local map_data = {}

View file

@ -398,6 +398,8 @@ local function world_conquest_tek_map_repaint_6a()
world_conquest_tek_map_dirt("Gg^Uf,Gs^Uf")
end
local _ = wesnoth.textdomain 'wesnoth-wc'
return function()
set_map_name(_"Rural")
world_conquest_tek_map_noise_classic("Gs^Fp")

View file

@ -88,13 +88,13 @@ function roads_to_river(radius)
--old implementation: wct_iterate_roads_to(wct_roads_to_river, 3, "Rp")
end
-- todo: the old code used
-- todo: the old code used
-- `wct_iterate_roads_to(wct_roads_to_river, 3, "Rp")`
-- but the new code uses roads_to_river(4) i guess
-- wct_iterate_roads_to_ex defeind radiosu differently thatn
-- wct_iterate_roads_to_ex defeind radiosu differently thatn
-- wct_iterate_roads_to ?
-- anyway leavong this function in as a sekeltong on how
-- wct_iterate_roads_to worked. in particular if we want to convert the remaining cases to
-- anyway leavong this function in as a sekeltong on how
-- wct_iterate_roads_to worked. in particular if we want to convert the remaining cases to
-- wct_iterate_roads_to_ex
function wct_roads_to_river(radius)
@ -447,6 +447,8 @@ function world_conquest_tek_map_repaint_6b()
wct_noise_snow_to("Rb")
end
local _ = wesnoth.textdomain 'wesnoth-wc'
return function()
set_map_name(_"Maritime")
wct_enemy_castle_expansion()

View file

@ -683,6 +683,8 @@ local function world_conquest_tek_map_repaint_6c()
end
local _ = wesnoth.textdomain 'wesnoth-wc'
return function()
set_map_name(_"Industrial")
wct_enemy_castle_expansion()

View file

@ -1,6 +1,6 @@
-- Feudal
-- unused function, replaces by roads_to_feudal_castle below,
-- unused function, replaces by roads_to_feudal_castle below,
-- the odl code used
-- `wct_iterate_roads_to(wct_roads_to_feudal_castle, 3, "Rr")`
-- instead of `roads_to_feudal_castle(3)`
@ -467,6 +467,7 @@ local function world_conquest_tek_map_repaint_6d()
end
local _ = wesnoth.textdomain 'wesnoth-wc'
return function()
set_map_name(_"Feudal")