summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Blanchard <tchaik@gmx.com>2019-03-07 22:02:50 +0000
committerMartin Blanchard <tchaik@gmx.com>2019-03-07 22:21:33 +0000
commit8745e3f2630cdad6b1715b4a074e4efc4db14534 (patch)
treeda3019e353448a591033a9105ad5c3c961e53d8b
parent23c22e50f1eef2d5b5fb88f999849e8cba131ee8 (diff)
downloadibus-hangul-8745e3f2630cdad6b1715b4a074e4efc4db14534.tar.gz
build: Prefer gettext over intltool
The intltool module is outdated: https://wiki.gnome.org/Initiatives/GnomeGoals/GettextMigration
-rw-r--r--.gitignore4
-rwxr-xr-xautogen.sh1
-rw-r--r--configure.ac14
-rw-r--r--data/Makefile.am7
-rw-r--r--data/org.freedesktop.ibus.engine.hangul.metainfo.xml.in6
-rw-r--r--m4/Makefile.am8
-rw-r--r--po/Makevars39
-rw-r--r--po/POTFILES.in4
-rw-r--r--po/POTFILES.skip2
-rw-r--r--setup/Makefile.am7
-rw-r--r--setup/ibus-setup-hangul.desktop.in4
11 files changed, 73 insertions, 23 deletions
diff --git a/.gitignore b/.gitignore
index ab40040..381fc2f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -35,9 +35,6 @@ stamp-h1
py-compile
ibus-hangul*.tar.*
ibus-hangul.spec
-intltool-extract.in
-intltool-merge.in
-intltool-update.in
# vim temp backup file
.*.swp
@@ -49,7 +46,6 @@ data/org.freedesktop.ibus.engine.hangul.metainfo.xml.h
# files for po
po/*.gmo
po/*.pot
-po/.intltool-merge-cache
po/stamp-po
po/stamp-it
diff --git a/autogen.sh b/autogen.sh
index 60c29de..d05c799 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -24,7 +24,6 @@ if [ "$#" = 0 -a "x$NOCONFIGURE" = "x" ]; then
fi
aclocal --install || exit 1
-intltoolize --force --copy --automake || exit 1
autoreconf --verbose --force --install || exit 1
cd "$olddir"
diff --git a/configure.ac b/configure.ac
index 2e1177d..932fa67 100644
--- a/configure.ac
+++ b/configure.ac
@@ -51,7 +51,8 @@ AC_ISC_POSIX
AC_HEADER_STDC
AM_PROG_LIBTOOL
-IT_PROG_INTLTOOL([0.35.0])
+AM_GNU_GETTEXT_VERSION([0.19.8])
+AM_GNU_GETTEXT([external])
# check ibus
PKG_CHECK_MODULES(IBUS, [
@@ -76,13 +77,16 @@ AC_ARG_WITH(python,
AM_PATH_PYTHON([2.5])
# define GETTEXT_* variables
-GETTEXT_PACKAGE=ibus-hangul
+GETTEXT_PACKAGE=AC_PACKAGE_NAME
AC_SUBST(GETTEXT_PACKAGE)
-AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Define to the read-only architecture-independent data directory.])
-
+AC_DEFINE_UNQUOTED(
+ GETTEXT_PACKAGE, "$GETTEXT_PACKAGE",
+ [Define to the read-only architecture-independent data directory.]
+)
# OUTPUT files
-AC_CONFIG_FILES([ po/Makefile.in
+AC_CONFIG_FILES([
+po/Makefile.in
Makefile
ibus-hangul.spec
src/Makefile
diff --git a/data/Makefile.am b/data/Makefile.am
index dbd73f9..fc04996 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -32,9 +32,12 @@ symboltable_DATA = \
symboltabledir = $(datadir)/ibus-hangul/data
appstream_in_files = org.freedesktop.ibus.engine.hangul.metainfo.xml.in
-appstream_DATA = $(appstream_in_files:.xml.in=.xml)
+appstream_files = $(appstream_in_files:.xml.in=.xml)
+appstream_DATA = $(appstream_files)
appstreamdir=$(datadir)/metainfo
-@INTLTOOL_XML_RULE@
+
+$(appstream_files): $(appstream_in_files) Makefile
+ $(AM_V_GEN)$(MSGFMT) --xml --template $< -d $(top_srcdir)/po -o $@
install-data-hook:
if test -z "$(DESTDIR)"; then \
diff --git a/data/org.freedesktop.ibus.engine.hangul.metainfo.xml.in b/data/org.freedesktop.ibus.engine.hangul.metainfo.xml.in
index 7a31585..05e6c8e 100644
--- a/data/org.freedesktop.ibus.engine.hangul.metainfo.xml.in
+++ b/data/org.freedesktop.ibus.engine.hangul.metainfo.xml.in
@@ -4,11 +4,9 @@
<name>ibus-hangul</name>
<metadata_license>CC0-1.0</metadata_license>
<project_license>GPL-2</project_license>
- <_summary>Hangul engine for IBus</_summary>
+ <summary>Hangul engine for IBus</summary>
<description>
- <_p>
- IBus-Hangul is a Korean input method engine for IBus.
- </_p>
+ <p>IBus-Hangul is a Korean input method engine for IBus.</p>
</description>
<project_group>IBus</project_group>
<url type="homepage">https://github.com/libhangul/ibus-hangul</url>
diff --git a/m4/Makefile.am b/m4/Makefile.am
index 675bb5f..5b9d60f 100644
--- a/m4/Makefile.am
+++ b/m4/Makefile.am
@@ -20,4 +20,12 @@
EXTRA_DIST = \
as-version.m4 \
+ gettext.m4 \
+ iconv.m4 \
+ lib-ld.m4 \
+ lib-link.m4 \
+ lib-prefix.m4 \
+ nls.m4 \
+ po.m4 \
+ progtest.m4 \
$(NULL)
diff --git a/po/Makevars b/po/Makevars
index 7d73dbd..fabb0ac 100644
--- a/po/Makevars
+++ b/po/Makevars
@@ -8,7 +8,7 @@ subdir = po
top_builddir = ..
# These options get passed to xgettext.
-XGETTEXT_OPTIONS = --keyword=_ --keyword=N_
+XGETTEXT_OPTIONS = --from-code=UTF-8 --keyword=_ --keyword=N_ --keyword=C_:1c,2 --keyword=NC_:1c,2 --keyword=g_dngettext:2,3 --add-comments
# This is the copyright holder that gets inserted into the header of the
# $(DOMAIN).pot file. Set this to the copyright holder of the surrounding
@@ -20,6 +20,13 @@ XGETTEXT_OPTIONS = --keyword=_ --keyword=N_
# their copyright.
COPYRIGHT_HOLDER = Huang Peng <shawn.p.huang@gmail.com>
+# This tells whether or not to prepend "GNU " prefix to the package
+# name that gets inserted into the header of the $(DOMAIN).pot file.
+# Possible values are "yes", "no", or empty. If it is empty, try to
+# detect it automatically by scanning the files in $(top_srcdir) for
+# "GNU packagename" string.
+PACKAGE_GNU = no
+
# This is the email address or URL to which the translators shall report
# bugs in the untranslated strings:
# - Strings which are not entire sentences, see the maintainer guidelines
@@ -39,3 +46,33 @@ MSGID_BUGS_ADDRESS = $(PACKAGE_BUGREPORT)
# This is the list of locale categories, beyond LC_MESSAGES, for which the
# message catalogs shall be used. It is usually empty.
EXTRA_LOCALE_CATEGORIES =
+
+# This tells whether the $(DOMAIN).pot file contains messages with an 'msgctxt'
+# context. Possible values are "yes" and "no". Set this to yes if the
+# package uses functions taking also a message context, like pgettext(), or
+# if in $(XGETTEXT_OPTIONS) you define keywords with a context argument.
+USE_MSGCTXT = yes
+
+# These options get passed to msgmerge.
+# Useful options are in particular:
+# --previous to keep previous msgids of translated messages,
+# --quiet to reduce the verbosity.
+MSGMERGE_OPTIONS =
+
+# These options get passed to msginit.
+# If you want to disable line wrapping when writing PO files, add
+# --no-wrap to MSGMERGE_OPTIONS, XGETTEXT_OPTIONS, and
+# MSGINIT_OPTIONS.
+MSGINIT_OPTIONS =
+
+# This tells whether or not to regenerate a PO file when $(DOMAIN).pot
+# has changed. Possible values are "yes" and "no". Set this to no if
+# the POT file is checked in the repository and the version control
+# program ignores timestamps.
+PO_DEPENDS_ON_POT = no
+
+# This tells whether or not to forcibly update $(DOMAIN).pot and
+# regenerate PO files on "make dist". Possible values are "yes" and
+# "no". Set this to no if the POT file and PO files are maintained
+# externally.
+DIST_DEPENDS_ON_UPDATE_PO = no
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 1248184..b32396d 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -1,7 +1,7 @@
-[type: gettext/xml]data/org.freedesktop.ibus.engine.hangul.metainfo.xml.in
+data/org.freedesktop.ibus.engine.hangul.metainfo.xml.in
setup/keycapturedialog.py
setup/main.py
setup/ibus-setup-hangul.desktop.in
-[type: gettext/glade]setup/setup.ui
+setup/setup.ui
src/engine.c
src/main.c
diff --git a/po/POTFILES.skip b/po/POTFILES.skip
new file mode 100644
index 0000000..77352ad
--- /dev/null
+++ b/po/POTFILES.skip
@@ -0,0 +1,2 @@
+data/org.freedesktop.ibus.engine.hangul.metainfo.xml
+setup/ibus-setup-hangul.desktop
diff --git a/setup/Makefile.am b/setup/Makefile.am
index 2425834..41ba0ac 100644
--- a/setup/Makefile.am
+++ b/setup/Makefile.am
@@ -31,9 +31,12 @@ setup_hanguldir = $(pkgdatadir)/setup
libexec_SCRIPTS = ibus-setup-hangul
desktop_in_files = ibus-setup-hangul.desktop.in
-desktop_DATA = ibus-setup-hangul.desktop
+desktop_files = $(desktop_in_files:.desktop.in=.desktop)
+desktop_DATA = $(desktop_files)
desktopdir = $(datadir)/applications
-@INTLTOOL_DESKTOP_RULE@
+
+$(desktop_files): $(desktop_in_files) Makefile
+ $(AM_V_GEN)$(MSGFMT) --desktop --template $< -d $(top_srcdir)/po -o $@
hicolor_icon_64_DATA = ibus-setup-hangul.png
hicolor_icon_64dir = $(datadir)/icons/hicolor/64x64/apps
diff --git a/setup/ibus-setup-hangul.desktop.in b/setup/ibus-setup-hangul.desktop.in
index e3326d4..b19934e 100644
--- a/setup/ibus-setup-hangul.desktop.in
+++ b/setup/ibus-setup-hangul.desktop.in
@@ -1,6 +1,6 @@
[Desktop Entry]
-_Name=IBus Hangul Preferences
-_Comment=Set IBus Hangul Preferences
+Name=IBus Hangul Preferences
+Comment=Set IBus Hangul Preferences
Exec=ibus-setup-hangul
Icon=ibus-setup-hangul
NoDisplay=true