aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/po
diff options
context:
space:
mode:
authorWolfgang Müller2021-06-26 15:32:40 +0200
committerWolfgang Müller2021-06-27 18:31:06 +0200
commite03fdccc4e191e0e7cd60b4fef9e6f603ccc112b (patch)
treeaede7a26eb41b0a8066016f471448289391d85c8 /po
parentb70083a5f4404e2422ff0a0aadd023a661164fae (diff)
downloadweltschmerz-e03fdccc4e191e0e7cd60b4fef9e6f603ccc112b.tar.gz
Prepare for internationalization
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
Diffstat (limited to 'po')
-rw-r--r--po/LINGUAS0
-rw-r--r--po/POTFILES0
-rw-r--r--po/meson.build7
3 files changed, 7 insertions, 0 deletions
diff --git a/po/LINGUAS b/po/LINGUAS
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/po/LINGUAS
diff --git a/po/POTFILES b/po/POTFILES
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/po/POTFILES
diff --git a/po/meson.build b/po/meson.build
new file mode 100644
index 0000000..6870f58
--- /dev/null
+++ b/po/meson.build
@@ -0,0 +1,7 @@
+i18n = import('i18n')
+
+localedir = join_paths(get_option('prefix'), get_option('localedir'))
+add_project_arguments('-DGETTEXT_PACKAGE="weltschmerz"', language: 'c')
+add_project_arguments('-DLOCALEDIR="@0@"'.format(localedir), language: 'c')
+
+i18n.gettext(meson.project_name(), args: '--directory=' + meson.source_root())