| Commit message (Collapse) | Author | Lines |
|
Currently po/update-pot.sh assumes English strings and translator
comments cannot contain characters outside of ASCII, and throws an error
upon encountering any. Since we are actually using UTF-8 and not ASCII,
tell xgettext so.
|
|
Currently weltschmerz has separate context menus for the two types of
URIs one can interact with, even though they contain the same option
with only a little different phrasing. This makes both use the same
context menu, and standardizes terminology to "URI".
This unification is in preparation for an upcoming "Open with …" feature
which will programmatically add items to context menu for URIs. Without
this, we would need to duplicate logic for each of the separate menus.
|
|
This commit enables 'errexit' for both shell scripts in po/, ensuring
that no further action is taken should one of the commands fail.
init-po.sh now tests for the presence of a language code and refuses to
continue if none is given.
|
|
meson's tooling for gettext introduces a couple of issues. Firstly, it
is currently not possible [1] to specify per-language keywords. We need
this in order to ignore the 'Name' record in the desktop file.
Secondly, every invocation of 'update-po' also updates the pot file [2],
inadvertently recording the updated creation date in all translations.
Since we recommended the use of 'update-po' to translators in TRANSLATE,
this will lead to lots of unrelated changes every time a new translation
is added, even if no msgids change.
Thirdly, people who do not have meson installed are currently not able
to use the tooling it provides.
To fix these issues, this commit adds custom tooling around gettext: The
'update-pot.sh' script updates the pot and po files using xgettext(1)
and msgmerge(1), and 'init-po.sh' makes the necessary changes to LINGUAS
whilst also creating the relevant po file(s) with msginit(1).
We no longer need to refer to meson at all in TRANSLATE. Make sure to
mention the new scripts as well.
[1] https://github.com/mesonbuild/meson/issues/1739
[2] https://github.com/mesonbuild/meson/blob/a9e9b7c7501a3c8a5984a93879d1f309bf8c72aa/mesonbuild/scripts/gettext.py#L112
|
|
|
|
|
|
Since the default setting of ASCII-only could potentially bite us in the
long run, make sure to have xgettext interpret files as UTF-8.
|
|
This is the mail .pot file that all future translations will use as a
base. Since the header is supposed to be filled out by translators in
the .po file, we can leave it as-is. This also makes subsequent updates
to this file easier, since it is generated by a tool.
|
|
|
|
For some translatable strings we need to provide more context to the
translators. Conveniently, xgettext [1] provides the '-c[tag]' flag for
this. Make sure to pass along any comment containing "TRANSLATORS"
preceding a gettext call to the .pot file.
[1] https://www.gnu.org/software/gettext/manual/html_node/xgettext-Invocation.html
|
|
weltschmerz currently does not allow for translation and exists in
English only. This is a serious defect for people who do not speak that
language. The following series of commits aims to remedy this by adding
the necessary infrastructure and build steps to enable easy translation.
To do this we use GNU gettext[1]; its tooling is widely supported and a
de-facto standard. Since we need to tell gettext where to find the
compiled .mo translation files, have both the Makefile and meson pass
the locale directory to weltschmerz in form of a LOCALEDIR macro. The
translation domain will be "weltschmerz".
Not only will any strings in the Vala code have to be translated, we
need to make sure to translate terminal.ui and weltschmerz.desktop as
well. The former will be taken care of through POTFILES only, but for
the latter we have to define an intermediary build step. To ensure
compatibility with the Makefile, we suffix the desktop file with '.in'.
For now, LINGUAS and POTFILES remain empty. A future commit will
document all files needing translation. LINGUAS will be updated as
translations are completed.
[1] https://www.gnu.org/software/gettext
|