strings versus translatable strings

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

Moderators: Forum Moderators, Developers

strings versus translatable strings

Postby doofus-01 » June 12th, 2017, 4:31 am

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
User avatar
doofus-01
Art Contributor
 
Posts: 3554
Joined: January 6th, 2008, 9:27 pm
Location: USA, the civilized part.

Re: strings versus translatable strings

Postby gfgtdf » June 12th, 2017, 11:57 am

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.
gfgtdf
Developer
 
Posts: 910
Joined: February 10th, 2013, 2:25 pm

Re: strings versus translatable strings

Postby Pentarctagon » June 13th, 2017, 12:05 am

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
Pentarctagon
Forum Administrator
 
Posts: 2948
Joined: March 22nd, 2009, 10:50 pm
Location: Earth (occasionally)

Re: strings versus translatable strings

Postby doofus-01 » June 13th, 2017, 3:06 am

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
doofus-01
Art Contributor
 
Posts: 3554
Joined: January 6th, 2008, 9:27 pm
Location: USA, the civilized part.

Re: strings versus translatable strings

Postby Celtic_Minstrel » July 23rd, 2017, 3:00 am

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.
User avatar
Celtic_Minstrel
Developer
 
Posts: 769
Joined: August 3rd, 2012, 11:26 pm


Return to Lua Labs

Who is online

Users browsing this forum: No registered users and 1 guest