Appears to be unused, and is still Python2 code. To be Python3, these
lines need to change:
- f = file(fn)
+ f = open(fn, encoding="utf-8")
- gettext = f.read().decode("utf8")
+ gettext = f.read()
Even knowing how to make it work, it still doesn't seem useful to keep.
wmlunits uses html_output.Translation, but that's not this class. It's
a wrapper around Python's standard gettext library, in html_output.py.
The original code was probably meant to strip trailing whitespace, which
turned out to be a bug when 4be9aa8584
fixed the buggy regexp so that it started working. That has now been
removed.
Fixed handling of multiline plural strings, which was broken too.
One feature has been left unimplemented, and will cause wmlxgettext to error
out. For "long bracketed" strings, Lua allows the contents to start with a
newline, which is automatically stripped from the resulting string. Trying to
understand the original purpose lead me to this feature of Lua strings which we
don't use in Wesnoth; and I finally concluded that, if someone wants to use
that feature, it can be their problem to implement it.
This fixes commit 4be9aa8584.
(cherry picked from commit e4239634e5)
The idea of using multiples of 5 seems like a way to avoid having to change
multiple campaigns' ranks at once, because it leaves space to rearrange a
mainline campaign between two other campaigns.
But enforcing "it must be a multiple of 5, even if that means changing other
campaigns" loses the advantage of using multiples. For example, WoF currently
has rank=152, which triggers the warning, which has caused a PR to be opened
that changes WoF, SoF, LoW and SotA - because keeping them in order requires
four campaigns to change.
(cherry picked from commit 42822ac374)
This will automatically record the gender (if specified) of each
[unit], [unit_type] and [side].
The hint "gender=male,female" is often applied to [unit_type]name=,
although that's usually the male name. I believe that's the only
downside of this change.