String change suggestion
Moderator: Forum Moderators
String change suggestion
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
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!
Re: String change suggestion
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?
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
Re: String change suggestion
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
Re: String change suggestion
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.
Also, the number goes *down* as you defeat enemies. After you've killed 25, the scenario ends.
Re: String change suggestion
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:
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?
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!"
Re: String change suggestion
As we don't ask ngettext to retreive the string, editing your PO files that way is not going to do any good.
Re: String change suggestion
So, is there a way you can ask ngettext in future versions?
Re: String change suggestion
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
Re: String change suggestion
Thanks!
I have added info about this string to the bug.
I have added info about this string to the bug.
Re: String change suggestion
I have added another use case to the bug. This one definitely merits plural handling.
Text domain: wesnoth
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
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)"
40-21 cuairtean
20 cuairt
19-13 cuairtean
12-11 chuairt
10-3 cuairtean
2-1 chuairt
0 cuairt