Some variables are not translatable
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
widelands |
Fix Released
|
Low
|
Unassigned |
Bug Description
An example:
The message sent to a player when for instance a quarry runs out of stone is this:
https:/
which corresponds to the following lines in src/logic/worker.cc
+
While the message itself is translated and shown in the correct language, the name of the ware is shown in English no matter what. I assume this is since it uses the value from the variable, which isn't translated. While it is obvious that the quarry has run out of stone, since that's what it's producing, the message ends up mixing languages which seems a bit strange.
I believe the same issue affects loading of a map, when it shows which tribe is loaded:
loading tribe: barbarians
Would it be possible to translate variables such as these? I understand from the way out of resources checks wares, it needs to use the internal name, but it could perhaps be translated before it is presented to the end user? I'm not sure if this can actually be fixed in an easy way, but by filing this report it's a known issue at least.
Related branches
- SirVer: Needs Fixing
-
Diff: 57 lines (+9/-5)3 files modifiedsrc/editor/editorinteractive.cc (+2/-2)
src/logic/editor_game_base.cc (+1/-1)
src/logic/worker.cc (+6/-2)
- SirVer: Approve
-
Diff: 1406 lines (+307/-102)79 files modifiedsrc/ai/defaultai.cc (+2/-2)
src/logic/militarysite.cc (+3/-3)
src/logic/militarysite.h (+1/-1)
src/logic/production_program.cc (+6/-7)
src/logic/production_program.h (+1/-1)
src/logic/productionsite.cc (+41/-1)
src/logic/productionsite.h (+22/-0)
src/logic/worker.cc (+8/-50)
src/logic/worker.h (+0/-4)
tribes/atlanteans/blackroot_farm/conf (+5/-0)
tribes/atlanteans/coalmine/conf (+4/-0)
tribes/atlanteans/crystalmine/conf (+4/-0)
tribes/atlanteans/farm/conf (+5/-0)
tribes/atlanteans/fishers_house/conf (+4/-0)
tribes/atlanteans/goldmine/conf (+4/-0)
tribes/atlanteans/hunters_house/conf (+6/-0)
tribes/atlanteans/ironmine/conf (+4/-0)
tribes/atlanteans/quarry/conf (+6/-2)
tribes/atlanteans/stonecutter/conf (+1/-1)
tribes/atlanteans/well/conf (+5/-0)
tribes/atlanteans/woodcutters_house/conf (+5/-0)
tribes/barbarians/coalmine/conf (+4/-0)
tribes/barbarians/deep_coalmine/conf (+4/-0)
tribes/barbarians/deep_goldmine/conf (+4/-0)
tribes/barbarians/deep_oremine/conf (+4/-0)
tribes/barbarians/deeper_coalmine/conf (+4/-0)
tribes/barbarians/deeper_goldmine/conf (+4/-0)
tribes/barbarians/deeper_oremine/conf (+4/-0)
tribes/barbarians/farm/conf (+5/-0)
tribes/barbarians/fishers_hut/conf (+4/-0)
tribes/barbarians/goldmine/conf (+4/-0)
tribes/barbarians/granitemine/conf (+4/-0)
tribes/barbarians/hunters_hut/conf (+6/-0)
tribes/barbarians/lumberjacks_hut/conf (+5/-0)
tribes/barbarians/oremine/conf (+4/-0)
tribes/barbarians/quarry/conf (+5/-1)
tribes/barbarians/reed_yard/conf (+5/-0)
tribes/barbarians/stonemason/conf (+1/-1)
tribes/barbarians/well/conf (+5/-0)
tribes/empire/coalmine/conf (+4/-0)
tribes/empire/deep_coalmine/conf (+4/-0)
tribes/empire/deep_goldmine/conf (+4/-0)
tribes/empire/deep_marblemine/conf (+4/-0)
tribes/empire/deep_oremine/conf (+4/-0)
tribes/empire/farm/conf (+5/-0)
tribes/empire/fishers_house/conf (+4/-0)
tribes/empire/goldmine/conf (+4/-0)
tribes/empire/hunters_house/conf (+6/-0)
tribes/empire/lumberjacks_house/conf (+5/-0)
tribes/empire/marblemine/conf (+4/-0)
tribes/empire/oremine/conf (+4/-0)
tribes/empire/quarry/conf (+6/-2)
tribes/empire/stonemason/conf (+2/-2)
tribes/empire/vineyard/conf (+5/-0)
tribes/empire/well/conf (+5/-0)
world/immovables/stones/blackland_stones1/init.lua (+1/-1)
world/immovables/stones/blackland_stones2/init.lua (+1/-1)
world/immovables/stones/blackland_stones3/init.lua (+1/-1)
world/immovables/stones/blackland_stones4/init.lua (+1/-1)
world/immovables/stones/blackland_stones5/init.lua (+1/-1)
world/immovables/stones/blackland_stones6/init.lua (+1/-1)
world/immovables/stones/desert_stones1/init.lua (+1/-1)
world/immovables/stones/desert_stones2/init.lua (+1/-1)
world/immovables/stones/desert_stones3/init.lua (+1/-1)
world/immovables/stones/desert_stones4/init.lua (+1/-1)
world/immovables/stones/desert_stones5/init.lua (+1/-1)
world/immovables/stones/desert_stones6/init.lua (+1/-1)
world/immovables/stones/greenland_stones1/init.lua (+1/-1)
world/immovables/stones/greenland_stones2/init.lua (+1/-1)
world/immovables/stones/greenland_stones3/init.lua (+1/-1)
world/immovables/stones/greenland_stones4/init.lua (+1/-1)
world/immovables/stones/greenland_stones5/init.lua (+1/-1)
world/immovables/stones/greenland_stones6/init.lua (+1/-1)
world/immovables/stones/winterland_stones1/init.lua (+1/-1)
world/immovables/stones/winterland_stones2/init.lua (+1/-1)
world/immovables/stones/winterland_stones3/init.lua (+1/-1)
world/immovables/stones/winterland_stones4/init.lua (+1/-1)
world/immovables/stones/winterland_stones5/init.lua (+1/-1)
world/immovables/stones/winterland_stones6/init.lua (+1/-1)
Changed in widelands: | |
importance: | Undecided → Low |
Changed in widelands: | |
milestone: | build18-rc1 → build19-rc1 |
Changed in widelands: | |
assignee: | nobody → GunChleoc (gunchleoc) |
status: | Confirmed → In Progress |
Changed in widelands: | |
assignee: | GunChleoc (gunchleoc) → nobody |
Changed in widelands: | |
status: | Fix Committed → Fix Released |
variables can be translated just as any string. Just pass the variable to _() or directly to i18n::translate(). I am not sure what happens with string extraction if _() is used there but i18n::translate should work fine.