[atomix] Fixed #12: Migration to gettext



commit bcba86a423f6b5a70e296fadf0e6e74ce4ee9d5b
Author: Robert Roth <robert roth off gmail com>
Date:   Tue Mar 6 03:02:12 2018 +0200

    Fixed #12: Migration to gettext

 Makefile.am                |  9 ------
 autogen.sh                 |  2 +-
 configure.ac               |  3 +-
 data/Makefile.am           |  6 ++--
 data/atomix.appdata.xml.in | 12 +++----
 data/atomix.desktop.in     |  8 +++--
 po/Makevars                | 78 ++++++++++++++++++++++++++++++++++++++++++++++
 po/POTFILES.in             |  2 +-
 8 files changed, 97 insertions(+), 23 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index 0dd6269..5c2f1ad 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -2,12 +2,3 @@ ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
 
 SUBDIRS = po src data
 
-EXTRA_DIST = \
-        intltool-extract.in \
-        intltool-merge.in   \
-        intltool-update.in
-
-DISTCLEANFILES = \
-       intltool-extract \
-       intltool-merge \
-       intltool-update
diff --git a/autogen.sh b/autogen.sh
index fa7f5a6..18ab513 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -23,7 +23,7 @@ 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 61489c4..66ab65f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -41,7 +41,8 @@ dnl *******************************
 dnl Internationalization
 dnl *******************************
 
-IT_PROG_INTLTOOL([0.40.0])
+AM_GNU_GETTEXT_VERSION([0.19.8])
+AM_GNU_GETTEXT([external])
 
 GETTEXT_PACKAGE=atomix
 AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE],["$GETTEXT_PACKAGE"],[Gettext domain])
diff --git a/data/Makefile.am b/data/Makefile.am
index 7199de6..2b3430c 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -5,18 +5,20 @@ SUBDIRS = level themes ui icons
 logodir = $(pkgdatadir)
 logo_DATA = atomix-logo.png
 
-@INTLTOOL_DESKTOP_RULE@
 
 appstream_in_files = atomix.appdata.xml.in
 appstream_XML = $(appstream_in_files:.xml.in=.xml)
+$(appstream_XML): $(appstream_in_files)
+       $(AM_V_GEN)$(MSGFMT) --xml --template $< -d $(top_srcdir)/po -o $@
 
 @APPSTREAM_XML_RULES@
 
-@INTLTOOL_XML_RULE@
 
 appdir = $(datadir)/applications
 app_in_files = atomix.desktop.in
 app_DATA = $(app_in_files:.desktop.in=.desktop)
+$(app_DATA): $(app_in_files)
+       $(AM_V_GEN)$(MSGFMT) --desktop --template $< -d $(top_srcdir)/po -o $@
 
 EXTRA_DIST = \
     $(appstream_in_files) \
diff --git a/data/atomix.appdata.xml.in b/data/atomix.appdata.xml.in
index 146cb5a..67deb19 100644
--- a/data/atomix.appdata.xml.in
+++ b/data/atomix.appdata.xml.in
@@ -4,19 +4,19 @@
   <id>atomix.desktop</id>
   <metadata_license>CC0-1.0</metadata_license>
   <project_license>GPL-2.0+</project_license>
-  <_name>Atomix</_name>
-  <_summary>Build molecules out of single atoms</_summary>
+  <name>Atomix</name>
+  <summary>Build molecules out of single atoms</summary>
   <description>
-    <_p>
+    <p>
       Atomix is a puzzle game where your goal is to assemble molecules from
       compound atoms by moving them on the playfield.
       However, atoms don't just move wherever you want to move them to, they
       slide until they hit either a wall or another atom.
-    </_p>
-    <_p>
+    </p>
+    <p>
       Try to build the molecules as fast as you can on each level to earn a
       higher score.
-    </_p>
+    </p>
   </description>
   <screenshots>
     <screenshot height="557" width="686" type="default">
diff --git a/data/atomix.desktop.in b/data/atomix.desktop.in
index fa4204d..4db8b7c 100644
--- a/data/atomix.desktop.in
+++ b/data/atomix.desktop.in
@@ -1,12 +1,14 @@
 [Desktop Entry]
-_Name=Atomix
-_GenericName=Molecule puzzle game
-_Comment=A puzzle game about atoms and molecules
+Name=Atomix
+GenericName=Molecule puzzle game
+Comment=A puzzle game about atoms and molecules
 Exec=atomix
+# Translators: Do NOT translate or transliterate this text (this is an icon file name)!
 Icon=atomix
 Terminal=false
 Type=Application
 Categories=GNOME;GTK;Game;LogicGame;
+# Translators: Search terms to find this application. Do NOT translate or localize the semicolons! The list 
MUST also end with a semicolon!
 Keywords=GNOME;game;logic;puzzle;atoms;molecules;sokoban;
 X-GNOME-Bugzilla-Bugzilla=GNOME
 X-GNOME-Bugzilla-Product=atomix
diff --git a/po/Makevars b/po/Makevars
new file mode 100644
index 0000000..ba37602
--- /dev/null
+++ b/po/Makevars
@@ -0,0 +1,78 @@
+# Makefile variables for PO directory in any package using GNU gettext.
+ 
+# Usually the message domain is the same as the package name.
+DOMAIN = $(PACKAGE)
+ 
+# These two variables depend on the location of this directory.
+subdir = po
+top_builddir = ..
+ 
+# These options get passed to xgettext.
+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
+# package.  (Note that the msgstr strings, extracted from the package's
+# sources, belong to the copyright holder of the package.)  Translators are
+# expected to transfer the copyright for their translations to this person
+# or entity, or to disclaim their copyright.  The empty string stands for
+# the public domain; in this case the translators are expected to disclaim
+# their copyright.
+COPYRIGHT_HOLDER = Atomix Contributors
+ 
+# 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
+#   in the GNU gettext documentation, section 'Preparing Strings'.
+# - Strings which use unclear terms or require additional context to be
+#   understood.
+# - Strings which make invalid assumptions about notation of date, time or
+#   money.
+# - Pluralisation problems.
+# - Incorrect English spelling.
+# - Incorrect formatting.
+# It can be your email address, or a mailing list address where translators
+# can write to without being subscribed, or the URL of a web page through
+# which the translators can contact you.
+MSGID_BUGS_ADDRESS = https://gitlab.gnome.org/GNOME/atomix/issues/new?issue
+ 
+# 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 042635a..8c3cc92 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -19,7 +19,7 @@ data/level/propylene.atomix.xml
 data/level/pyran.atomix.xml
 data/level/transbutylen.atomix.xml
 data/level/water.atomix.xml
-[type: gettext/glade]data/ui/interface.ui
+data/ui/interface.ui
 src/board-gtk.c
 src/level-manager.c
 src/main.c


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]