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 4be9aa85849010e93a9a3b0f0701d0630e7b9368
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 4be9aa85849010e93a9a3b0f0701d0630e7b9368.
(cherry picked from commit e4239634e5094410478fa6b1d91df3be4ddf1caf)
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 42822ac374cc74515bbb253ebaf0819da4010def)
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.
* Run auto-format
* Avoid broad exception handling.
* Remove unnecessary reference to self.
* Tidy imports.
* Remove redundant brackets.
* Narrow exception handling on unrecognised locale.
* Simplify command construction.
* Simplify command construction.
* Avoid shadowing.
* Spelling corrections.
* Reviewed argument parsing:
* Average user probably won't know that ISO 15897 refers to POSIX locale names.
* 'default' probably isn't an accurate description of the entered locale so change to 'user'.
* Remove the hard-coded usage text - the default usage string from the arguments list is sufficient.
* Use title case for menus as per UI style guide.
* Avoid abbreviation for UI text and add translation notes.
* Reviewed text for the tabs representing options for each tool.
Also removed forced new-lines, which I think are unnecessary.
* Consolidate strings to allow for translation sharing.
* Add translation note
* Use title case for titles.
* End sentences with full-stop.
* Title case for titles, translation note, full-stop.
* Abbreviated error message sufficient - consistent with other error messages.
* Clarify file vs file name.
* The translations directory is referenced regardless of whether the user has specified a locale or not, so put the check for the translation directory outside the user-input condition.
* The function isn't just for the user-specified locale, it steps back to the system locale if no user-input is given for the language.
* Clarified the reason for the code duplication in the set-up for system locale.
* Use en_US for commentary.
* Treat 'normal mode' as just one string.
* Replace empty place-holder with numbered indexes to work around gettext limitation.
* Correct typography.