Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[1.15] objectives show "%d turns left" in non en_US locale #4165

Open
stevecotton opened this issue Jul 14, 2019 · 9 comments

Comments

@stevecotton
Copy link
Contributor

commented Jul 14, 2019

In 1.15, the scenario objectives of any scenario that uses {TURNS_RUN_OUT} will show a %d to the user. The bug is locale-specific:

  • in en_US, the bug doesn't happen. The user sees "Turns run out (24 turns left)"
  • in en_GB, the user sees "Turns run out (%d turns left)"
  • in Spanish, the user sees "Se acaban los turnos (%d turnos restantes)

I haven't debugged why, but 12ada04 changed the plural form to "($remaining_turns turns left)" without changing the singular form. I'm guessing Gettext is using the translation with msgid "(this turn left)" even though the msgid_plural doesn't match.

Platform: Debian Unstable, amd64
Boost version: 1.67
Building Wesnoth from commit: 0bd3682
Reproduced in scenarios: AoI S1, WoV S2

@jostephd

This comment has been minimized.

Copy link
Member

commented Jul 14, 2019

I'm guessing Gettext is using the translation with msgid "(this turn left)" even though the msgid_plural doesn't match.

That does seem to be what's happening; you can see it easily by changing the plural strings in HttT S23:

[lua]
code=<<
function wesnoth.wml_actions.show_countdown(cfg)
local vars = wml.variables
local _ = wesnoth.textdomain "wesnoth-httt"
local n = vars.units_to_slay
local obj = _("Defeat one more enemy unit", "Defeat $units_to_slay enemy units", n)
vars.units_to_slay_obj = wesnoth.format(obj, {units_to_slay = n})
if not cfg.silent then
local splash = _("Still $units_to_slay clan member to defeat!", "Still $units_to_slay clan members to defeat!", n)
wesnoth.wml_actions.print{
text = wesnoth.format(splash, {units_to_slay = n}),
size = 18,
red = 255, green = 255, blue = 255
}
end
end
>>
[/lua]

This does beg the question of when string freeze for 1.15.0 will start. @Vultraz ?

@jostephd jostephd added this to the 1.15.0 milestone Jul 14, 2019

@Vultraz

This comment has been minimized.

Copy link
Member

commented Jul 14, 2019

What needs to be done to fix this, then?

@jostephd

This comment has been minimized.

Copy link
Member

commented Jul 15, 2019

Not sure. Maybe regenerating the po files will fix it? But then we'll have an untranslated plural string.

@AI0867

This comment has been minimized.

Copy link
Member

commented Jul 17, 2019

This is something that can be fixed mechanically: replacing %d with $remaining_turns| in the msgid_plural and the msgstrs should do the trick. Can pofix do this?

@jostephd

This comment has been minimized.

Copy link
Member

commented Jul 17, 2019

@AI0867 I guess so but I'm not sure. Also, that would fix the problem only for this one string. Are there any other strings where the plural message was changed but the singular message not changed?

@gfgtdf

This comment has been minimized.

Copy link
Contributor

commented Jul 18, 2019

This does beg the question of when string freeze for 1.15.0 will start. @Vultraz ?

Iirc Dev releases have no string freeze, but I could be wrong.

@CelticMinstrel

This comment has been minimized.

Copy link
Member

commented Jul 18, 2019

I think pofix can do it only if there's no other strings that use %d.

@jostephd

This comment has been minimized.

Copy link
Member

commented Jul 18, 2019

@gfgtdf I assumed we'd want to have uptodate translations in 1.15.0 to encourage testing by players who don't speak English. I guess most of the UI strings and so on will carry over from 1.14, but areas that have new strings are generally exactly the areas we want to have testing of.

@soliton-

This comment has been minimized.

Copy link
Member

commented Jul 18, 2019

Having uptodate translations certainly doesn't hurt but it also means lots of work for translators that can be in vain at any moment because we decide to reorganize/rewrite stuff. Usually translators get more active when we're nearing a new stable version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
7 participants
You can’t perform that action at this time.