[gnome-builder/wip/tingping/upstream-gettext] Modernize gettext usage and replace intltool



commit 4998290aca24d8a0b6e1ef8788f9180a45786410
Author: Patrick Griffis <tingping tingping se>
Date:   Thu Jul 21 16:20:32 2016 -0400

    Modernize gettext usage and replace intltool

 Makefile.am                           |   14 +-----
 autogen.sh                            |    2 -
 configure.ac                          |    5 +-
 data/Makefile.am                      |    8 ++-
 data/org.gnome.Builder.appdata.xml.in |   36 ++++++------
 data/org.gnome.Builder.desktop.in.in  |    6 +-
 po/.gitignore                         |    1 +
 po/Makevars                           |   78 ++++++++++++++++++++++++++
 po/POTFILES.in                        |   96 ++++++++++++++++----------------
 9 files changed, 157 insertions(+), 89 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index eb24352..a26c115 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -2,23 +2,10 @@ SUBDIRS = . build contrib data libide src libidemm plugins tools po tests doc he
 
 ACLOCAL_AMFLAGS = -I build/autotools
 
-INTLTOOL_FILES = \
-       intltool-extract.in \
-       intltool-merge.in \
-       intltool-update.in \
-       $(NULL)
-
 EXTRA_DIST = \
-       $(INTLTOOL_FILES) \
        AUTHORS \
        $(NULL)
 
-DISTCLEANFILES = \
-       intltool-extract \
-       intltool-merge \
-       intltool-update \
-       po/.intltool-merge-cache
-
 # --disable-gtk-doc until future notice
 DISTCHECK_CONFIGURE_FLAGS = \
        --enable-introspection \
@@ -39,6 +26,7 @@ GITIGNOREFILES = \
        gtk-doc.m4 \
        gtk-doc.make \
        INSTALL \
+       ABOUT-NLS \
        $(NULL)
 
 AUTHORS:
diff --git a/autogen.sh b/autogen.sh
index 3189b7b..b59f861 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -18,8 +18,6 @@ touch ChangeLog
 touch INSTALL
 
 aclocal --install -I build/autotools || exit 1
-glib-gettextize --force --copy || exit 1
-intltoolize --force --copy --automake || exit 1
 gtkdocize || exit 1
 
 if command -v mm-common-prepare 2>/dev/null; then
diff --git a/configure.ac b/configure.ac
index 62a6064..5b5bd18 100644
--- a/configure.ac
+++ b/configure.ac
@@ -55,12 +55,11 @@ AM_MAINTAINER_MODE([enable])
 dnl ***********************************************************************
 dnl Internationalization
 dnl ***********************************************************************
-AX_REQUIRE_DEFINED([IT_PROG_INTLTOOL])
-IT_PROG_INTLTOOL([0.50.1])
 GETTEXT_PACKAGE=AC_PACKAGE_TARNAME
 AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE], ["$GETTEXT_PACKAGE"], [GETTEXT package name])
 AC_SUBST(GETTEXT_PACKAGE)
-AM_GLIB_GNU_GETTEXT
+AM_GNU_GETTEXT_VERSION([0.19.7])
+AM_GNU_GETTEXT([external])
 
 
 dnl ***********************************************************************
diff --git a/data/Makefile.am b/data/Makefile.am
index b8e9974..df62a0a 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -1,17 +1,21 @@
 SUBDIRS = gsettings icons style-schemes fonts .
 
 @APPSTREAM_XML_RULES@
-@INTLTOOL_XML_RULE@
 
 appstream_in_files = org.gnome.Builder.appdata.xml.in
 appstream_XML = $(appstream_in_files:.xml.in=.xml)
 
+%.appdata.xml: %.appdata.xml.in
+       $(AM_V_GEN)$(MSGFMT) --xml --template $< -d $(top_srcdir)/po -o $@
+
 # Desktop launcher and description file.
 desktopdir = $(datadir)/applications
 desktop_in_in_files = org.gnome.Builder.desktop.in.in
 desktop_in_files = org.gnome.Builder.desktop.in
 desktop_DATA = $(desktop_in_files:.desktop.in=.desktop)
-@INTLTOOL_DESKTOP_RULE@
+
+%.desktop: %.desktop.in
+       $(AM_V_GEN)$(MSGFMT) --desktop --template $< -d $(top_srcdir)/po -o $@
 
 # D-Bus service file.
 servicedir = $(datadir)/dbus-1/services
diff --git a/data/org.gnome.Builder.appdata.xml.in b/data/org.gnome.Builder.appdata.xml.in
index ee4ea04..deec9d3 100644
--- a/data/org.gnome.Builder.appdata.xml.in
+++ b/data/org.gnome.Builder.appdata.xml.in
@@ -4,33 +4,33 @@
   <id>org.gnome.Builder.desktop</id>
   <metadata_license>CC0</metadata_license>
   <project_license>GPL-3.0+ and GPL-2.0+ and LGPL-3.0+ and LGPL-2.0+ and MIT</project_license>
-  <_name>Builder</_name>
-  <_summary>An IDE for GNOME</_summary>
+  <name>Builder</name>
+  <summary>An IDE for GNOME</summary>
 
   <description>
-    <_p>
+    <p>
       Builder is an actively developed Integrated Development Environment for
       GNOME. It combines integrated support for essential GNOME technologies
       such as GTK+, GLib, and GNOME APIs with features that any developer will
       appreciate, like syntax highlighting and snippets.
-    </_p>
-    <_p>
+    </p>
+    <p>
       You can rely on predictable releases of Builder with each new release of
       GNOME every six months.
-    </_p>
-    <_p>Features:</_p>
+    </p>
+    <p>Features:</p>
     <ul>
-      <_li>Built in syntax highlighting for many languages</_li>
-      <_li>Side-by-side code editors</_li>
-      <_li>Integration with Git</_li>
-      <_li>Integration with Autotools</_li>
-      <_li>Clang based auto-completion, semantic highlighting, and diagnostics</_li>
-      <_li>Python based auto-completion, semantic highlighting, and diagnostics</_li>
-      <_li>Vala based auto-completion and diagnostics</_li>
-      <_li>Auto indentation support for C, Python, Vala, and XML</_li>
-      <_li>HTML/Markdown live preview</_li>
-      <_li>Optional Vim-style editing</_li>
-      <_li>Preview support for building with Xdg-App runtimes</_li>
+      <li>Built in syntax highlighting for many languages</li>
+      <li>Side-by-side code editors</li>
+      <li>Integration with Git</li>
+      <li>Integration with Autotools</li>
+      <li>Clang based auto-completion, semantic highlighting, and diagnostics</li>
+      <li>Python based auto-completion, semantic highlighting, and diagnostics</li>
+      <li>Vala based auto-completion and diagnostics</li>
+      <li>Auto indentation support for C, Python, Vala, and XML</li>
+      <li>HTML/Markdown live preview</li>
+      <li>Optional Vim-style editing</li>
+      <li>Preview support for building with Xdg-App runtimes</li>
     </ul>
   </description>
 
diff --git a/data/org.gnome.Builder.desktop.in.in b/data/org.gnome.Builder.desktop.in.in
index d65b682..799b9c5 100644
--- a/data/org.gnome.Builder.desktop.in.in
+++ b/data/org.gnome.Builder.desktop.in.in
@@ -1,6 +1,6 @@
 [Desktop Entry]
-_Name=Builder
-_Comment=Build software for GNOME
+Name=Builder
+Comment=Build software for GNOME
 Exec=gnome-builder %U
 Icon=org.gnome.Builder
 DBusActivatable=true
@@ -8,5 +8,5 @@ StartupNotify=true
 Terminal=false
 Type=Application
 Categories=GNOME;GTK;Development;IDE;
-_Keywords=Build;Develop;
+Keywords=Build;Develop;
 
MimeType=text/x-c;text/x-csrc;text/x-changelog;text/x-chdr;text/x-c++hdr;text/x-python;application/x-python;application/javascript;application/x-javascript;text/x-javascript;text/javascript;text/x-js;text/x-shellscript;application/x-shellscript;text/x-sh;text/x-vala;text/x-makefile;text/x-c++;text/x-cpp;text/x-c++src;text/css;application/x-gnome-app-info;application/x-desktop;text/x-go;text/html;text/x-markdown;application/json;application/x-m4;application/xml;text/xml;application/x-yaml;text/x-sql;application/x-ruby;text/x-ruby;text/x-pkg-config;text/x-lua;text/x-php;application/x-php;text/x-php-source;application/x-php-source;text/x-perl;application/x-perl;
diff --git a/po/.gitignore b/po/.gitignore
index 72113b6..2c382e3 100644
--- a/po/.gitignore
+++ b/po/.gitignore
@@ -1,5 +1,6 @@
 *.gmo
 Makefile.in.in
+Makevars.template
 POTFILES
 gnome-builder.pot
 stamp-it
diff --git a/po/Makevars b/po/Makevars
new file mode 100644
index 0000000..dad02bf
--- /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
+
+# 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 = Free Software Foundation, Inc.
+
+# 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 =
+
+# 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 =
+
+# 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 = no
+
+# 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 = yes
+
+# 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 = yes
diff --git a/po/POTFILES.in b/po/POTFILES.in
index c0950d1..37b6878 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -10,28 +10,28 @@ contrib/gstyle/gstyle-color-plane.c
 contrib/gstyle/gstyle-color-widget-actions.c
 contrib/gstyle/gstyle-palette.c
 contrib/gstyle/gstyle-palette-widget.c
-[type: gettext/glade]contrib/gstyle/tests/data/gstyle-color-editor.ui
+contrib/gstyle/tests/data/gstyle-color-editor.ui
 contrib/gstyle/tests/data/palette.xml
-[type: gettext/glade]contrib/gstyle/ui/gstyle-color-panel.ui
-[type: gettext/glade]contrib/gstyle/ui/gstyle-color-widget.ui
-[type: gettext/glade]contrib/gstyle/ui/gstyle-rename-popover.ui
+contrib/gstyle/ui/gstyle-color-panel.ui
+contrib/gstyle/ui/gstyle-color-widget.ui
+contrib/gstyle/ui/gstyle-rename-popover.ui
 contrib/pnl/pnl-animation.c
 contrib/search/trie.c
 contrib/tmpl/tmpl-parser.c
 contrib/tmpl/tmpl-template.c
 contrib/tmpl/tmpl-template-locator.c
 contrib/xml/xml-reader.c
-[type: gettext/gsettings]data/gsettings/org.gnome.builder.build.gschema.xml.in
-[type: gettext/gsettings]data/gsettings/org.gnome.builder.code-insight.gschema.xml.in
-[type: gettext/gsettings]data/gsettings/org.gnome.builder.editor.gschema.xml.in
-[type: gettext/gsettings]data/gsettings/org.gnome.builder.editor.language.gschema.xml.in
-[type: gettext/gsettings]data/gsettings/org.gnome.builder.extension-type.gschema.xml.in
-[type: gettext/gsettings]data/gsettings/org.gnome.builder.gschema.xml.in
-[type: gettext/gsettings]data/gsettings/org.gnome.builder.plugin.gschema.xml.in
-[type: gettext/gsettings]data/gsettings/org.gnome.builder.project-tree.gschema.xml.in
-[type: gettext/gsettings]data/gsettings/org.gnome.builder.terminal.gschema.xml.in
-[type: gettext/gsettings]data/gsettings/org.gnome.builder.workbench.gschema.xml.in
-[type: gettext/glade]data/gtk/menus.ui
+data/gsettings/org.gnome.builder.build.gschema.xml.in
+data/gsettings/org.gnome.builder.code-insight.gschema.xml.in
+data/gsettings/org.gnome.builder.editor.gschema.xml.in
+data/gsettings/org.gnome.builder.editor.language.gschema.xml.in
+data/gsettings/org.gnome.builder.extension-type.gschema.xml.in
+data/gsettings/org.gnome.builder.gschema.xml.in
+data/gsettings/org.gnome.builder.plugin.gschema.xml.in
+data/gsettings/org.gnome.builder.project-tree.gschema.xml.in
+data/gsettings/org.gnome.builder.terminal.gschema.xml.in
+data/gsettings/org.gnome.builder.workbench.gschema.xml.in
+data/gtk/menus.ui
 data/org.gnome.Builder.appdata.xml.in
 data/org.gnome.Builder.desktop.in.in
 data/style-schemes/builder-dark.xml
@@ -50,26 +50,26 @@ libide/devices/ide-device-manager.c
 libide/directory/ide-directory-vcs.c
 libide/editorconfig/ide-editorconfig-file-settings.c
 libide/editor/ide-editor-frame.c
-[type: gettext/glade]libide/editor/ide-editor-frame.ui
+libide/editor/ide-editor-frame.ui
 libide/editor/ide-editor-layout-stack-controls.c
-[type: gettext/glade]libide/editor/ide-editor-layout-stack-controls.ui
+libide/editor/ide-editor-layout-stack-controls.ui
 libide/editor/ide-editor-perspective.c
-[type: gettext/glade]libide/editor/ide-editor-perspective.ui
-[type: gettext/glade]libide/editor/ide-editor-tweak-widget.ui
+libide/editor/ide-editor-perspective.ui
+libide/editor/ide-editor-tweak-widget.ui
 libide/editor/ide-editor-view-actions.c
 libide/editor/ide-editor-view.c
-[type: gettext/glade]libide/editor/ide-editor-view.ui
+libide/editor/ide-editor-view.ui
 libide/greeter/ide-greeter-perspective.c
-[type: gettext/glade]libide/greeter/ide-greeter-perspective.ui
+libide/greeter/ide-greeter-perspective.ui
 libide/gsettings/ide-language-defaults.c
 libide/ide.c
 libide/ide-context.c
 libide/ide-object.c
-[type: gettext/glade]libide/keybindings/ide-shortcuts-window.ui
+libide/keybindings/ide-shortcuts-window.ui
 libide/preferences/ide-preferences-builtin.c
-[type: gettext/glade]libide/preferences/ide-preferences-font-button.ui
+libide/preferences/ide-preferences-font-button.ui
 libide/preferences/ide-preferences-perspective.c
-[type: gettext/glade]libide/preferences/ide-preferences-perspective.ui
+libide/preferences/ide-preferences-perspective.ui
 libide/projects/ide-project.c
 libide/projects/ide-recent-projects.c
 libide/pygobject/ide-pygobject-script.c
@@ -84,27 +84,27 @@ libide/snippets/ide-source-snippets-manager.c
 libide/sourceview/ide-source-view.c
 libide/util/ide-file-manager.c
 libide/util/ide-uri.c
-[type: gettext/glade]libide/workbench/ide-layout-tab-bar.ui
-[type: gettext/glade]libide/workbench/ide-layout-tab.ui
+libide/workbench/ide-layout-tab-bar.ui
+libide/workbench/ide-layout-tab.ui
 libide/workbench/ide-layout-view.c
 libide/workbench/ide-omni-bar.c
 libide/workbench/ide-omni-bar-row.c
-[type: gettext/glade]libide/workbench/ide-omni-bar-row.ui
-[type: gettext/glade]libide/workbench/ide-omni-bar.ui
+libide/workbench/ide-omni-bar-row.ui
+libide/workbench/ide-omni-bar.ui
 libide/workbench/ide-workbench-actions.c
 libide/workbench/ide-workbench.c
-[type: gettext/glade]libide/workbench/ide-workbench-header-bar.ui
+libide/workbench/ide-workbench-header-bar.ui
 plugins/autotools/ide-autotools-builder.c
 plugins/autotools/ide-autotools-build-system.c
 plugins/autotools/ide-autotools-build-task.c
 plugins/autotools/ide-makecache.c
 plugins/autotools-templates/autotools_templates/__init__.py
-[type: gettext/glade]plugins/build-tools/gbp-build-configuration-row.ui
-[type: gettext/glade]plugins/build-tools/gbp-build-configuration-view.ui
+plugins/build-tools/gbp-build-configuration-row.ui
+plugins/build-tools/gbp-build-configuration-view.ui
 plugins/build-tools/gbp-build-log-panel.c
 plugins/build-tools/gbp-build-panel.c
 plugins/build-tools/gbp-build-panel-row.c
-[type: gettext/glade]plugins/build-tools/gbp-build-panel.ui
+plugins/build-tools/gbp-build-panel.ui
 plugins/build-tools/gbp-build-tool.c
 plugins/build-tools/ide-environment-editor.c
 plugins/clang/ide-clang-preferences-addin.c
@@ -115,53 +115,53 @@ plugins/color-picker/data/basic.xml
 plugins/color-picker/gb-color-picker-prefs.c
 plugins/color-picker/gb-color-picker-prefs-palette-row.c
 plugins/color-picker/gb-color-picker-workbench-addin.c
-[type: gettext/glade]plugins/color-picker/gtk/color-picker-palette-menu.ui
-[type: gettext/glade]plugins/color-picker/gtk/color-picker-prefs.ui
-[type: gettext/glade]plugins/color-picker/gtk/color-picker-preview.ui
-[type: gettext/glade]plugins/color-picker/gtk/color-picker.ui
-[type: gettext/glade]plugins/color-picker/gtk/menus.ui
+plugins/color-picker/gtk/color-picker-palette-menu.ui
+plugins/color-picker/gtk/color-picker-prefs.ui
+plugins/color-picker/gtk/color-picker-preview.ui
+plugins/color-picker/gtk/color-picker.ui
+plugins/color-picker/gtk/menus.ui
 plugins/command-bar/gb-command-bar.c
 plugins/command-bar/gb-vim.c
-[type: gettext/glade]plugins/comment-code/gtk/menus.ui
+plugins/comment-code/gtk/menus.ui
 plugins/contributing/contributing_plugin/helper.py
 plugins/contributing/contributing_plugin/__init__.py
 plugins/c-pack/ide-c-format-provider.c
 plugins/create-project/gbp-create-project-genesis-addin.c
 plugins/create-project/gbp-create-project-tool.c
 plugins/create-project/gbp-create-project-widget.c
-[type: gettext/glade]plugins/create-project/gbp-create-project-widget.ui
+plugins/create-project/gbp-create-project-widget.ui
 plugins/devhelp/gbp-devhelp-panel.c
 plugins/devhelp/gbp-devhelp-search-provider.c
 plugins/file-search/gb-file-search-provider.c
-[type: gettext/glade]plugins/fpaste/fpaste_plugin/gtk/menus.ui
+plugins/fpaste/fpaste_plugin/gtk/menus.ui
 plugins/fpaste/fpaste_plugin/__init__.py
 plugins/git/ide-git-buffer-change-monitor.c
 plugins/git/ide-git-clone-widget.c
-[type: gettext/glade]plugins/git/ide-git-clone-widget.ui
+plugins/git/ide-git-clone-widget.ui
 plugins/git/ide-git-genesis-addin.c
 plugins/git/ide-git-remote-callbacks.c
 plugins/gnome-code-assistance/ide-gca-diagnostic-provider.c
 plugins/gnome-code-assistance/ide-gca-preferences-addin.c
 plugins/gnome-code-assistance/ide-gca-service.c
 plugins/hello-cpp/hellocppapplicationaddin.cc
-[type: gettext/glade]plugins/html-preview/html_preview_plugin/gtk/menus.ui
+plugins/html-preview/html_preview_plugin/gtk/menus.ui
 plugins/jedi/jedi_plugin.py
 plugins/mingw/ide-mingw-device-provider.c
 plugins/project-tree/gb-new-file-popover.c
-[type: gettext/glade]plugins/project-tree/gb-new-file-popover.ui
+plugins/project-tree/gb-new-file-popover.ui
 plugins/project-tree/gb-project-tree-addin.c
 plugins/project-tree/gb-project-tree-builder.c
 plugins/project-tree/gb-rename-file-popover.c
-[type: gettext/glade]plugins/project-tree/gb-rename-file-popover.ui
-[type: gettext/glade]plugins/project-tree/gtk/menus.ui
+plugins/project-tree/gb-rename-file-popover.ui
+plugins/project-tree/gtk/menus.ui
 plugins/python-pack/ide-python-format-provider.c
 plugins/run-tools/gbp-run-workbench-addin.c
-[type: gettext/glade]plugins/support/gtk/menus.ui
+plugins/support/gtk/menus.ui
 plugins/support/ide-support-application-addin.c
 plugins/symbol-tree/symbol-tree-panel.c
-[type: gettext/glade]plugins/sysmon/gb-sysmon-panel.ui
+plugins/sysmon/gb-sysmon-panel.ui
 plugins/terminal/gb-terminal-view-actions.c
 plugins/terminal/gb-terminal-workbench-addin.c
-[type: gettext/glade]plugins/terminal/gtk/menus.ui
+plugins/terminal/gtk/menus.ui
 plugins/todo/todo_plugin/__init__.py
 plugins/vala-pack/ide-vala-preferences-addin.vala


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