strings versus translatable strings

Discussion of Lua and LuaWML support, development, and ideas.

Moderators: Forum Moderators, Developers

Post Reply
User avatar
doofus-01
Art Director
Posts: 3907
Joined: January 6th, 2008, 9:27 pm
Location: USA

strings versus translatable strings

Post by doofus-01 »

wesnoth.show_popup_dialog (https://wiki.wesnoth.org/LuaWML/Display ... pup_dialog) is an easy way to bring up a message box that resembles the [objectives] we all see at the start of a scenario. (It also resembles the old-style messages, before they were moved to the bottom of the screen.)

I'm not sure whether this is just a matter of me being rusty or whether there is a bug in wesnoth.show_popup_dialog, but passing a translatable string to that function causes an error. I've looked at what works with wesnoth.show_dialog, but it's not clear to me how to apply it. It seems like there might be a hint at https://wiki.wesnoth.org/LuaWML/Display ... textdomain, but I don't understand what it's saying and don't put too much stock in that. Does anyone know of a working example of wesnoth.show_popup_dialog?

Thanks.
BfW 1.12 supported, but active development only for BfW 1.13/1.14: Bad Moon Rising | Trinity | Archaic Era |
| Abandoned: Tales of the Setting Sun
GitHub link for these projects

gfgtdf
General Code Maintainer
Posts: 1332
Joined: February 10th, 2013, 2:25 pm

Re: strings versus translatable strings

Post by gfgtdf »

you coudl file a bugreport. As a workaroudn you can simply add a tostring() call on the prameter of wesnoth.show_popup_dialog
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.

User avatar
Pentarctagon
Project Manager
Posts: 4432
Joined: March 22nd, 2009, 10:50 pm
Location: Earth (occasionally)

Re: strings versus translatable strings

Post by Pentarctagon »

There's data/lua/wml/object.lua:66 in mainline, which I would assume works.
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code

User avatar
doofus-01
Art Director
Posts: 3907
Joined: January 6th, 2008, 9:27 pm
Location: USA

Re: strings versus translatable strings

Post by doofus-01 »

Pentarctagon wrote:There's data/lua/wml/object.lua:66 in mainline, which I would assume works.
I'll assume it works too. (Not sure how I missed that.) It uses tostring(), like gfgtdf said. Is that a workaround of a bug, or is it customizing a flexibility? Maybe it doesn't matter.
Thanks.
BfW 1.12 supported, but active development only for BfW 1.13/1.14: Bad Moon Rising | Trinity | Archaic Era |
| Abandoned: Tales of the Setting Sun
GitHub link for these projects

User avatar
Celtic_Minstrel
Developer
Posts: 1662
Joined: August 3rd, 2012, 11:26 pm
Location: Canada
Contact:

Re: strings versus translatable strings

Post by Celtic_Minstrel »

I'd say show_popup_dialog should be changed to accept translatable strings though. It would be pretty easy to do, just call luaW_checktstring or something instead of luaL_checkstring.
Author of The Black Cross of Aleron campaign and Default++ era.
Maintainer of Steelhive.

Post Reply