String change suggestion

Discuss and coordinate development of mainline and user-made content translations.

Moderator: Forum Moderators

Post Reply
User avatar
GunChleoc
Translator
Posts: 506
Joined: September 28th, 2012, 7:35 am
Contact:

String change suggestion

Post by GunChleoc »

I didn't find an appropriate thread for this, so please feel free to move.

In the Heir to the Throne campaign, there's a string that should be solit into singular and plural

Code: Select all

Still $units_to_slay clan members to defeat!
User avatar
Adamant14
Posts: 968
Joined: April 24th, 2010, 1:14 pm

Re: String change suggestion

Post by Adamant14 »

Sorry if I am wrong, but I think singular can not happen.
There are always 25 ore more enemies to defeat, otherwise the player wins, right?
Author of Antar, Son of Rheor ( SP Campaign) | Development Thread + Feedback Thread + Replays of ASoR
User avatar
GunChleoc
Translator
Posts: 506
Joined: September 28th, 2012, 7:35 am
Contact:

Re: String change suggestion

Post by GunChleoc »

But can you guarantee that all languages of the world use only one form for numbers from 25 to infinity? For example, have a look at Slovenian http://translate.sourceforge.net/wiki/l ... ralforms#s
AI
Developer
Posts: 2396
Joined: January 31st, 2008, 8:38 pm

Re: String change suggestion

Post by AI »

gettext (the translation library we use) has ngettext for this purpose (allowing arbitrary numbers of plural forms), which we do use in the engine, but it's not exposed to WML at this time.

Also, the number goes *down* as you defeat enemies. After you've killed 25, the scenario ends.
User avatar
GunChleoc
Translator
Posts: 506
Joined: September 28th, 2012, 7:35 am
Contact:

Re: String change suggestion

Post by GunChleoc »

Of course the number goes down, but what does it start with?

I'm not familiar enough with the internal workings of gettext to know if I can just add the plural forms to the string without it becoming fuzzy in the upload? E.g., can I do something like this:

Code: Select all

#. [print]
#: data/campaigns/Heir_To_The_Throne/scenarios/23_Test_of_the_Clans.cfg:503
msgid "Still $units_to_slay clan members to defeat!"
msgid_plural "Still $units_to_slay clan members to defeat!"
msgstr[0] ""
"Feumaidh tu buaidh a thoirt air $units_to_slay bhall a' chinnidh fhathast!"
msgstr[1] ""
"Feumaidh tu buaidh a thoirt air $units_to_slay bhall a' chinnidh fhathast!"
msgstr[2] ""
"Feumaidh tu buaidh a thoirt air $units_to_slay buill a' chinnidh fhathast!"
msgstr[3] ""
"Feumaidh tu buaidh a thoirt air $units_to_slay ball a' chinnidh fhathast!"
I have translated plural strings for Wesnoth before, so it should be possible to change the string, or is that only possible in certain parts of the game?
AI
Developer
Posts: 2396
Joined: January 31st, 2008, 8:38 pm

Re: String change suggestion

Post by AI »

As we don't ask ngettext to retreive the string, editing your PO files that way is not going to do any good.
User avatar
GunChleoc
Translator
Posts: 506
Joined: September 28th, 2012, 7:35 am
Contact:

Re: String change suggestion

Post by GunChleoc »

So, is there a way you can ask ngettext in future versions?
AI
Developer
Posts: 2396
Joined: January 31st, 2008, 8:38 pm

Re: String change suggestion

Post by AI »

Well, we'd probably need to define some new WML syntax for that. I've looked into this in the past. There' is also at least one bug filed for it: https://gna.org/bugs/?11811
User avatar
GunChleoc
Translator
Posts: 506
Joined: September 28th, 2012, 7:35 am
Contact:

Re: String change suggestion

Post by GunChleoc »

Thanks!

I have added info about this string to the bug.
User avatar
GunChleoc
Translator
Posts: 506
Joined: September 28th, 2012, 7:35 am
Contact:

Re: String change suggestion

Post by GunChleoc »

I have added another use case to the bug. This one definitely merits plural handling.

Text domain: wesnoth

Code: Select all

#: data/lua/wml/objectives.lua:71
msgid "(%d turns left)"
msgstr "(%d cuairtean air  fhàgail)"

#: data/lua/wml/objectives.lua:73
msgid "(this turn left)"
msgstr "(a’ chuairt seo air  fhàgail)"
These should be 1 string with plural handling. For example, when there are 2 turns left, "cuairtean" becomes "chuairt", so:

40-21 cuairtean
20 cuairt
19-13 cuairtean
12-11 chuairt
10-3 cuairtean
2-1 chuairt
0 cuairt
Post Reply