Untranslatable tooltip in [Lua] ?
Moderator: Forum Moderators
Untranslatable tooltip in [Lua] ?
Hi,
There was some time ago a post (I can no longer find it, was it deleted?) about how to create new unit status tooltips and get to show them with this code:
I've only copied the code, I don't quite understand Lua.
My problem is, that when I try to translate the UMC, the tooltip doesn't show in the translated language, even though it is marked translatable in the code.
Any workaround for this, or what am I doing wrong?
There was some time ago a post (I can no longer find it, was it deleted?) about how to create new unit status tooltips and get to show them with this code:
Code: Select all
[lua]
code=<<
local _ = wesnoth.textdomain "trs"
local old_unit_status = wesnoth.theme_items.unit_status
function wesnoth.theme_items.unit_status()
local u = wesnoth.get_displayed_unit()
if not u then return {} end
local s = old_unit_status()
if u.variables.poisoned then
table.insert(s, { "element", {
image = "misc/bleeding.png",
tooltip = _ "bleeding: This unit is bleeding out. It loses 4 HP every turn until it is healed or dies."
} })
end
return s
end
>>
[/lua]
My problem is, that when I try to translate the UMC, the tooltip doesn't show in the translated language, even though it is marked translatable in the code.
Any workaround for this, or what am I doing wrong?
Main UMC campaigns: The Ravagers - now for 1.16, with new bugs!
Old UMC works: The Underness Series, consisting of 5 parts: The Desolation of Karlag, The Blind Sentinel, The Stone of the North, The Invasion Of The Western Cavalry, Fingerbone of Destiny
Old UMC works: The Underness Series, consisting of 5 parts: The Desolation of Karlag, The Blind Sentinel, The Stone of the North, The Invasion Of The Western Cavalry, Fingerbone of Destiny
Re: Untranslatable tooltip in [Lua] ?
Code: Select all
local _ = wesnoth.textdomain "trs"
Discord: @tamanegi
It is true that we cannot be free from bugs, but at least let our bugs not always the same...
A Group in a War: my first campaign, An Independence War: and the sequel
It is true that we cannot be free from bugs, but at least let our bugs not always the same...
A Group in a War: my first campaign, An Independence War: and the sequel
Re: Untranslatable tooltip in [Lua] ?
Sorry for answering late.
It doesn't solve it :/
I rewrote the line to
which really is the textdomain btw, so it really was a bug, but still the tooltips don't show translated.
It doesn't solve it :/
I rewrote the line to
Code: Select all
local _ = wesnoth.textdomain "wesnoth-trs"
Main UMC campaigns: The Ravagers - now for 1.16, with new bugs!
Old UMC works: The Underness Series, consisting of 5 parts: The Desolation of Karlag, The Blind Sentinel, The Stone of the North, The Invasion Of The Western Cavalry, Fingerbone of Destiny
Old UMC works: The Underness Series, consisting of 5 parts: The Desolation of Karlag, The Blind Sentinel, The Stone of the North, The Invasion Of The Western Cavalry, Fingerbone of Destiny
Re: Untranslatable tooltip in [Lua] ?
You are right. Tooltips cannot be translated.
There maybe something wrong in the engine.
I also checked this issue in my campaigns (An Independence War for BfW 1.12 and A Group in a War for BfW 1.13), where wesnoth.theme_items are modified. The situation is completely the same as your one. Considering the fact that non-tooltip text can be translated, there maybe a translation problem specific to tooltips in wesnoth.theme_items.
There maybe something wrong in the engine.
I also checked this issue in my campaigns (An Independence War for BfW 1.12 and A Group in a War for BfW 1.13), where wesnoth.theme_items are modified. The situation is completely the same as your one. Considering the fact that non-tooltip text can be translated, there maybe a translation problem specific to tooltips in wesnoth.theme_items.
Discord: @tamanegi
It is true that we cannot be free from bugs, but at least let our bugs not always the same...
A Group in a War: my first campaign, An Independence War: and the sequel
It is true that we cannot be free from bugs, but at least let our bugs not always the same...
A Group in a War: my first campaign, An Independence War: and the sequel
- Celtic_Minstrel
- Developer
- Posts: 2255
- Joined: August 3rd, 2012, 11:26 pm
- Location: Canada
- Contact:
Re: Untranslatable tooltip in [Lua] ?
For the record, I think the original post about how to do this was moved to the Wiki somewhere in LuaWML or one of its subpages.
Back on topic, it seems kind of incredible that the tooltips would literally not support translations. In particular, surely all the built-in tooltips are translated? If those work, I don't see why custom ones wouldn't work. Have you verified that your translation pipeline is correct, that the English string appears in the pot-file, and that it has been translated in the po-file?
Back on topic, it seems kind of incredible that the tooltips would literally not support translations. In particular, surely all the built-in tooltips are translated? If those work, I don't see why custom ones wouldn't work. Have you verified that your translation pipeline is correct, that the English string appears in the pot-file, and that it has been translated in the po-file?