URL:
<http://gna.org/bugs/?11811>
Summary: Support for gettext plurals in WML
Project: Battle for Wesnoth
Submitted by: vladimirslavik
Submitted on: Tuesday 06/10/2008 at 15:00
Category: Feature Request
Severity: 2 - Minor
Priority: 5 - Normal
Item Group: WML
Status: None
Privacy: Public
Assigned to: None
Originator Email:
Open/Closed: Open
Discussion Lock: Any
Release: any
Operating System: Windows XP
_______________________________________________________
Details:
Apart from providing the basic translation with _"", it might be useful to
have full support for plurals as well.
There are two possible ways to achieve this:
1)
Adding some keys like message_plural and plural_var to all places where is
text that can be seen. The possible candidates for such extension are:
[message] message, [print] text, [label] text, [objectives] [objective] text
Other places are probably not worth attention as they aren't likely to show
anything with variable number.
Additionally something like [evaluate_plural] (could be part of
[set_variable]?) for retrieving already converted string could be useful
(although I can't really see UMC authors learning how to use that).
Example:
[message]
message = _"I have $count unit"
message_plural = _"I have $count units"
plural_var = $count
[/message]
Advantages: Already possible with current WML system without invasive
changes.
Disadvantages: Only directly "showable" strings can be pluralized. Quite a
lot harder on wml parser that extracts translatable stuff.
2)
Essentially extending representation of wml objects with "strings" that can
be a compound of three parts - singular, plural and variable for calculation.
The syntax can be anything... eg. _("sg", "pl", $var)
Example:
[message]
message = _("I have $count unit", "I have $count units", $count)
[/message]
Advantages: Slightly more intuitive usage, can be parts of string
concatenation like a+b+c.
Disadvantages: Big change to the way wml strings are - new type of "string"
that cannot be mixed ad hoc with normal strings without other effects - how
to store / when evaluate the expression if it's a part of something like
a+b+c?
_______________________________________________________
Reply to this item at:
<http://gna.org/bugs/?11811>
_______________________________________________
Message sent via/by Gna!
http://gna.org/
_______________________________________________
Wesnoth-bugs mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-bugs