how to get untranslated string
Moderator: Forum Moderators
how to get untranslated string
i have a translatable string object and i wonder how to get the untranslated string behind it.
does anyone know how to do that?
does anyone know how to do that?
Scenario with Robots SP scenario (1.11/1.12), allows you to build your units with components, PYR No preperation turn 1.12 mp-mod that allows you to select your units immideately after the game begins.
-
- Inactive Developer
- Posts: 2461
- Joined: August 15th, 2008, 8:46 pm
- Location: Germany
Re: how to get untranslated string
Calling tostring() on it always automatically translates it by calling the impl_tstring_tostring metamethod. In case the language setting is "American English" it should stay the same then as that's the language the strings should be in. There's no way to enforce this or to know whether it is the case.
Perhaps you should seriously ask yourself why you feel the need to do this ? Where does the string come from ? In case it is from your code you should have the answer yourself; in case it's not, it comes somewhere from core or the engine, in which case there should be a better alternative (such as unit ids for unit names etc).
Perhaps you should seriously ask yourself why you feel the need to do this ? Where does the string come from ? In case it is from your code you should have the answer yourself; in case it's not, it comes somewhere from core or the engine, in which case there should be a better alternative (such as unit ids for unit names etc).
projects (BfW 1.12):
A Simple Campaign: campaign draft for wml starters • Plan Your Advancements: mp mod
The Earth's Gut: sp campaign • Settlers of Wesnoth: mp scenario • Wesnoth Lua Pack: lua tags and utils
updated to 1.8 and handed over: A Gryphon's Tale: sp campaign
A Simple Campaign: campaign draft for wml starters • Plan Your Advancements: mp mod
The Earth's Gut: sp campaign • Settlers of Wesnoth: mp scenario • Wesnoth Lua Pack: lua tags and utils
updated to 1.8 and handed over: A Gryphon's Tale: sp campaign
Re: how to get untranslated string
the string comes from different sources, (from me aswell as from the core).
and i want this for my serialize function, if i replace a string by its translation that would ofc remove the translatability.
and i want this for my serialize function, if i replace a string by its translation that would ofc remove the translatability.
Scenario with Robots SP scenario (1.11/1.12), allows you to build your units with components, PYR No preperation turn 1.12 mp-mod that allows you to select your units immideately after the game begins.
Re: how to get untranslated string
I just took a look at src/scripting/lua.cpp, and there is no mention of the base_str() method of t_string, so you cannot retrieve the untranslated version.
Re: how to get untranslated string
ty for this info. i guess i'll have to drop translatability for savegames, make a complicated workaround, or use wesnoth.set_variable if the containing table is a valid wml table.
Scenario with Robots SP scenario (1.11/1.12), allows you to build your units with components, PYR No preperation turn 1.12 mp-mod that allows you to select your units immideately after the game begins.