aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/po
diff options
context:
space:
mode:
Diffstat (limited to 'po')
-rw-r--r--po/POTFILES1
-rw-r--r--po/init-po.sh8
-rw-r--r--po/meson.build4
-rw-r--r--po/update-pot.sh16
4 files changed, 25 insertions, 4 deletions
diff --git a/po/POTFILES b/po/POTFILES
index 107469c..4d9f89d 100644
--- a/po/POTFILES
+++ b/po/POTFILES
@@ -1,4 +1,3 @@
configreader.vala
terminal.ui
terminal.vala
-weltschmerz.desktop.in
diff --git a/po/init-po.sh b/po/init-po.sh
new file mode 100644
index 0000000..0830875
--- /dev/null
+++ b/po/init-po.sh
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+lang=$1
+
+echo "$lang" >> po/LINGUAS
+sort -u po/LINGUAS -o po/LINGUAS
+
+msginit -i po/weltschmerz.pot -o "po/${lang}.po" --locale "$lang" --no-translator
diff --git a/po/meson.build b/po/meson.build
index 5cbb15b..6870f58 100644
--- a/po/meson.build
+++ b/po/meson.build
@@ -4,6 +4,4 @@ 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(), '-c TRANSLATORS', '--from-code=UTF-8']
-)
+i18n.gettext(meson.project_name(), args: '--directory=' + meson.source_root())
diff --git a/po/update-pot.sh b/po/update-pot.sh
new file mode 100644
index 0000000..6ceb21f
--- /dev/null
+++ b/po/update-pot.sh
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+_xgettext() {
+ xgettext --package-name=weltschmerz -cTRANSLATORS "$@" -o po/weltschmerz.pot
+}
+
+_xgettext -f po/POTFILES
+
+# We treat this file specially in order to override the keywords used for it.
+# Since we do not want Name translated, reset the keyword list with -k and then
+# add the keywords we want.
+_xgettext -j -k -kComment -kKeywords weltschmerz.desktop.in
+
+while read lang; do
+ msgmerge -q -o "po/${lang}.po" "po/${lang}.po" po/weltschmerz.pot
+done < po/LINGUAS