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)
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.
* wmlxgettext: Support extracting all textdomains at once
- -o now expects a folder.
- --domain is now treated as an optional filter.
* wmltools/gui/wmlxgettext: Update input handling
- Fix --initialdomain
- Textdomain is no longer mandatory.
- Accept output dir rather than output file.
* wmlxgettext: Improve parser resiliency for malformed files
- WML files with no translatable strings will no longer
crash the script on unbalanced tags (but translatable will).
- .cfg files belonging to man(1) will no longer crash the script.
* Remove stray quotes from textdomain declarations
These are not recognized by the wmlxgettext parser.
* wmlxgettext: Error out on unused #po, #po-override directives
* wmlxgettext: Ignore out of domain #po, #po-override comments
* wmlxgettext: Properly clear pending #po, #po-override on textdomain switch
* Fix misplaced #po comments in DiD, SoF, TSG, Editor
Some of these ugly relocations can be reverted in or after #7570.