8 Commits

Author SHA1 Message Date
Steve Cotton
6f95b062cb wmlxgettext: Fix "fix invalid escape sequence"
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)
2024-04-02 16:12:23 +02:00
Toom
4be9aa8584 fix invalid escape sequence 2024-03-24 21:33:47 +01:00
Steve Cotton
ec1c336078 wmlxgettext: treat gender as a po hint
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.
2024-02-12 23:42:59 +01:00
Slayer95
4892963072
Refactor collection of #po, #po-override comments (#7574) 2023-07-12 22:47:26 +02:00
Slayer95
be991e027d
wmlxgettext: Support extracting all textdomains at once (#7624)
* 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.
2023-05-24 22:08:18 +02:00
Slayer95
36ed4641cd
wmlxgettext: Error out on unused #po, #po-override directives (#7573)
* 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.
2023-05-08 00:08:21 +02:00
Steve Cotton
c30c30acfc wmlxgettext: support double quotes in raw strings (fixes #4484)
This adds support for _<<map="{maps/01_First_Map.map}">>.
2019-10-19 20:37:39 +02:00
Celtic Minstrel
42c48d1483 Move wmlxgettext to the data/tools directory so that it's automatically included in official packages
(cherry-picked from commit 59e78e556593cea7650998611640aeff3a6b288f)
2018-10-07 03:24:58 +00:00