mirror of
https://github.com/luanti-org/modtools.git
synced 2026-04-17 08:47:32 +00:00
Add xgettext wrapper script (#11)
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
# `luanti_xgettext`
|
||||
|
||||
This script is a simple wrapper around `xgettext` that additionally passes
|
||||
Luanti-specific options. In particular, it lets `xgettext` recognize keywords
|
||||
that are used for client-side translations in Luanti.
|
||||
|
||||
In addition to `core.translate` and `core.translate_n`, this script follows the
|
||||
following convention:
|
||||
|
||||
* `S(str, ...)` is a wrapper for `core.translate(str, ...)`
|
||||
* `PS(str, str_plural, n)` is a wrapper for `core.translate_n(str, str_plural, n, ...)`.
|
||||
* `FS` and `FPS` are wrappers that additionally formspec-escape the result of `S` and `PS`, respectively.
|
||||
* `NS` and `NFS` are similar to `S` and `FS`, respectively, but they do not translate the string and instead allow the string to be translated later.
|
||||
|
||||
Refer to https://www.gnu.org/software/gettext/manual/html_node/xgettext-Invocation.html for further information on the usage of `xgettext`.
|
||||
Executable
+5
@@ -0,0 +1,5 @@
|
||||
#!/bin/sh
|
||||
xgettext -L lua --from-code=utf-8 \
|
||||
-kS -kNS -kFS -kNFS -kPS:1,2 -kFPS:1,2 \
|
||||
-kcore.translate:1c,2 -kcore.translate_n:1c,2,3 \
|
||||
"$@"
|
||||
Reference in New Issue
Block a user