gimp r28045 - in trunk: . app/core data data/tags po-tags



Author: aurisj
Date: Tue Feb 17 18:43:32 2009
New Revision: 28045
URL: http://svn.gnome.org/viewvc/gimp?rev=28045&view=rev

Log:
added support for tag translation, user installation and migration procedures for tags.xml.

Added:
   trunk/app/core/gimp-tags.c
   trunk/app/core/gimp-tags.h
   trunk/data/tags/
   trunk/data/tags/Makefile.am
   trunk/data/tags/gimp-tags-default.xml.in
   trunk/data/tags/gimp-tags.dtd
   trunk/po-tags/
   trunk/po-tags/ChangeLog
   trunk/po-tags/LINGUAS
   trunk/po-tags/Makefile.in.in
   trunk/po-tags/POTFILES.in
   trunk/po-tags/POTFILES.skip
   trunk/po-tags/lt.po
Modified:
   trunk/ChangeLog
   trunk/app/core/Makefile.am
   trunk/app/core/gimp-user-install.c
   trunk/configure.in
   trunk/data/Makefile.am

Modified: trunk/app/core/Makefile.am
==============================================================================
--- trunk/app/core/Makefile.am	(original)
+++ trunk/app/core/Makefile.am	Tue Feb 17 18:43:32 2009
@@ -33,6 +33,8 @@
 	gimp-modules.h				\
 	gimp-parasites.c			\
 	gimp-parasites.h			\
+	gimp-tags.c				\
+	gimp-tags.h				\
 	gimp-templates.c			\
 	gimp-templates.h			\
 	gimp-transform-region.c			\

Added: trunk/app/core/gimp-tags.c
==============================================================================
--- (empty file)
+++ trunk/app/core/gimp-tags.c	Tue Feb 17 18:43:32 2009
@@ -0,0 +1,236 @@
+/* GIMP - The GNU Image Manipulation Program
+ * Copyright (C) 1995 Spencer Kimball and Peter Mattis
+ *
+ * gimp-tags.c
+ * Copyright (C) 2009 Aurimas JuÅka <aurisj svn gnome org>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "config.h"
+
+#include <stdlib.h>
+#include <string.h>
+
+#include <glib-object.h>
+
+#include "libgimpbase/gimpbase.h"
+#include "libgimpmath/gimpmath.h"
+#include "libgimpconfig/gimpconfig.h"
+
+#include "core-types.h"
+
+#include "config/gimpxmlparser.h"
+
+#include "gimp-utils.h"
+#include "gimp-tags.h"
+
+#include "gimp-intl.h"
+
+
+#define GIMP_TAGS_FILE "tags.xml"
+
+typedef struct
+{
+  const gchar          *locale;
+  GString              *buf;
+  gboolean              locale_matches;
+} GimpTagsInstaller;
+
+static  void        gimp_tags_installer_load_start_element  (GMarkupParseContext *context,
+                                                             const gchar         *element_name,
+                                                             const gchar        **attribute_names,
+                                                             const gchar        **attribute_values,
+                                                             gpointer             user_data,
+                                                             GError             **error);
+static void         gimp_tags_installer_load_end_element (GMarkupParseContext *context,
+                                                          const gchar         *element_name,
+                                                          gpointer             user_data,
+                                                          GError             **error);
+static void         gimp_tags_installer_load_text (GMarkupParseContext *context,
+                                                   const gchar         *text,
+                                                   gsize                text_len,
+                                                   gpointer             user_data,
+                                                   GError             **error);
+static const gchar* attribute_name_to_value (const gchar  **attribute_names,
+                                             const gchar  **attribute_values,
+                                             const gchar   *name);
+
+
+gboolean
+gimp_tags_user_install (void)
+{
+  gchar                *filename;
+  GError               *error;
+  GMarkupParser         markup_parser;
+  GimpXmlParser        *xml_parser;
+  const char           *tags_locale;
+  GimpTagsInstaller     tags_installer = { 0, };
+  gboolean              result = TRUE;
+
+  /* This is a special string to specify the language identifier to
+     look for in the gimp-tags-default.xml file. Please translate the
+     C in it according to the name of the po file used for
+     gimp-tags-default.xml. E.g. lithuanian for the translation,
+     that would be "tags-locale:lt".
+   */
+  tags_locale = _("tags-locale:C");
+
+  if (g_str_has_prefix (tags_locale, "tags-locale:"))
+    {
+      tags_locale += strlen ("tags-locale:");
+
+      if (*tags_locale && *tags_locale != 'C')
+        tags_installer.locale = tags_locale;
+    }
+  else
+    {
+      g_warning ("Wrong translation for 'tags-locale:', fix the translation!");
+    }
+
+  tags_installer.buf = g_string_new (NULL);
+  g_string_append (tags_installer.buf, "<?xml version='1.0' encoding='UTF-8'?>\n");
+  g_string_append (tags_installer.buf, "<tags>\n");
+
+  filename = g_build_filename (gimp_data_directory (), "tags",
+                               "gimp-tags-default.xml", NULL);
+  error = NULL;
+
+  markup_parser.start_element = gimp_tags_installer_load_start_element;
+  markup_parser.end_element = gimp_tags_installer_load_end_element;
+  markup_parser.text = gimp_tags_installer_load_text;
+  markup_parser.passthrough = NULL;
+  markup_parser.error = NULL;
+  xml_parser = gimp_xml_parser_new (&markup_parser, &tags_installer);
+  result = gimp_xml_parser_parse_file (xml_parser, filename, &error);
+  g_free (filename);
+  gimp_xml_parser_free (xml_parser);
+  if (! result)
+    {
+      g_string_free (tags_installer.buf, TRUE);
+      return FALSE;
+    }
+
+  g_string_append (tags_installer.buf, "\n</tags>\n");
+
+  filename = g_build_filename (gimp_directory (), GIMP_TAGS_FILE, NULL);
+  error = NULL;
+  result = g_file_set_contents (filename, tags_installer.buf->str, tags_installer.buf->len, &error);
+  g_free (filename);
+  g_string_free (tags_installer.buf, TRUE);
+  if (! result)
+    {
+      g_warning ("Error while creating tags.xml: %s\n", error->message);
+      g_error_free (error);
+      return FALSE;
+    }
+
+  return TRUE;
+}
+
+static  void
+gimp_tags_installer_load_start_element  (GMarkupParseContext *context,
+                                         const gchar         *element_name,
+                                         const gchar        **attribute_names,
+                                         const gchar        **attribute_values,
+                                         gpointer             user_data,
+                                         GError             **error)
+{
+  GimpTagsInstaller *tags_installer = (GimpTagsInstaller*) user_data;
+
+  if (! strcmp (element_name, "resource"))
+    {
+      g_string_append_printf (tags_installer->buf, "\n  <resource");
+      while (*attribute_names)
+        {
+          g_string_append_printf (tags_installer->buf, " %s=\"%s\"",
+                                  *attribute_names, *attribute_values);
+
+          attribute_names++;
+          attribute_values++;
+        }
+      g_string_append_printf (tags_installer->buf, ">\n");
+    }
+  else if (! strcmp (element_name, "thetag"))
+    {
+      const char *current_locale;
+
+      current_locale = attribute_name_to_value (attribute_names, attribute_values, "xml:lang");
+      if (current_locale && tags_installer->locale)
+        {
+          tags_installer->locale_matches = !strcmp (current_locale, tags_installer->locale);
+        }
+      else
+        {
+          tags_installer->locale_matches = (current_locale == tags_installer->locale);
+        }
+    }
+}
+
+static void
+gimp_tags_installer_load_end_element (GMarkupParseContext *context,
+                                      const gchar         *element_name,
+                                      gpointer             user_data,
+                                      GError             **error)
+{
+  GimpTagsInstaller *tags_installer = (GimpTagsInstaller*) user_data;
+
+  if (strcmp (element_name, "resource") == 0)
+    {
+      g_string_append (tags_installer->buf, "  </resource>\n");
+    }
+}
+
+static void
+gimp_tags_installer_load_text (GMarkupParseContext *context,
+                               const gchar         *text,
+                               gsize                text_len,
+                               gpointer             user_data,
+                               GError             **error)
+{
+  GimpTagsInstaller *tags_installer = (GimpTagsInstaller*) user_data;
+  const gchar       *current_element;
+  gchar             *tag_string;
+
+  current_element = g_markup_parse_context_get_element (context);
+
+  if (tags_installer->locale_matches &&
+      current_element &&
+      strcmp (current_element, "thetag") == 0)
+    {
+      tag_string = g_markup_escape_text (text, text_len);
+      g_string_append_printf (tags_installer->buf, "    <tag>%s</tag>\n", tag_string);
+      g_free (tag_string);
+    }
+}
+
+static const gchar*
+attribute_name_to_value (const gchar  **attribute_names,
+                         const gchar  **attribute_values,
+                         const gchar   *name)
+{
+  while (*attribute_names)
+    {
+      if (! strcmp (*attribute_names, name))
+        {
+          return *attribute_values;
+        }
+
+      attribute_names++;
+      attribute_values++;
+    }
+
+  return NULL;
+}
+

Added: trunk/app/core/gimp-tags.h
==============================================================================
--- (empty file)
+++ trunk/app/core/gimp-tags.h	Tue Feb 17 18:43:32 2009
@@ -0,0 +1,25 @@
+/* GIMP - The GNU Image Manipulation Program
+ * Copyright (C) 1995-1997 Spencer Kimball and Peter Mattis
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __GIMP_TAGS_H__
+#define __GIMP_TAGS_H__
+
+
+gboolean gimp_tags_user_install (void);
+
+
+#endif  /*  __GIMP_TAGS_H__  */

Modified: trunk/app/core/gimp-user-install.c
==============================================================================
--- trunk/app/core/gimp-user-install.c	(original)
+++ trunk/app/core/gimp-user-install.c	Tue Feb 17 18:43:32 2009
@@ -46,6 +46,7 @@
 #include "config/gimprc.h"
 
 #include "gimp-templates.h"
+#include "gimp-tags.h"
 #include "gimp-user-install.h"
 
 #include "gimp-intl.h"
@@ -465,6 +466,11 @@
         }
     }
 
+  if (! gimp_tags_user_install ())
+    {
+      return FALSE;
+    }
+
   return TRUE;
 }
 
@@ -543,5 +549,17 @@
   gimp_rc_save (gimprc);
   g_object_unref (gimprc);
 
+  g_snprintf (dest, sizeof (dest), "%s%c%s",
+              gimp_directory (), G_DIR_SEPARATOR, "tags.xml");
+  if (! g_file_test (dest, G_FILE_TEST_IS_REGULAR))
+    {
+      /* if there was no tags.xml,
+       * install it with default tag set.*/
+      if (! gimp_tags_user_install ())
+        {
+          return FALSE;
+        }
+    }
+
   return TRUE;
 }

Modified: trunk/configure.in
==============================================================================
--- trunk/configure.in	(original)
+++ trunk/configure.in	Tue Feb 17 18:43:32 2009
@@ -2063,6 +2063,7 @@
 data/interpreters/Makefile
 data/palettes/Makefile
 data/patterns/Makefile
+data/tags/Makefile
 data/tips/Makefile
 desktop/Makefile
 desktop/gimp.desktop.in
@@ -2073,6 +2074,7 @@
 po-plug-ins/Makefile.in
 po-python/Makefile.in
 po-script-fu/Makefile.in
+po-tags/Makefile.in
 po-tips/Makefile.in
 gimp-zip
 Makefile
@@ -2094,6 +2096,7 @@
 sed -e "/POTFILES =/r po-python/POTFILES" po-python/Makefile.in > po-python/Makefile && touch po-python/stamp-it
 sed -e "/POTFILES =/r po-plug-ins/POTFILES" po-plug-ins/Makefile.in > po-plug-ins/Makefile && touch po-plug-ins/stamp-it
 sed -e "/POTFILES =/r po-script-fu/POTFILES" po-script-fu/Makefile.in > po-script-fu/Makefile && touch po-script-fu/stamp-it
+sed -e "/POTFILES =/r po-tags/POTFILES" po-tags/Makefile.in > po-tags/Makefile && touch po-tags/stamp-it
 sed -e "/POTFILES =/r po-tips/POTFILES" po-tips/Makefile.in > po-tips/Makefile && touch po-tips/stamp-it])
 
 AC_OUTPUT

Modified: trunk/data/Makefile.am
==============================================================================
--- trunk/data/Makefile.am	(original)
+++ trunk/data/Makefile.am	Tue Feb 17 18:43:32 2009
@@ -8,7 +8,8 @@
 	interpreters	\
 	palettes	\
 	patterns	\
-	tips
+	tips		\
+	tags
 
 fontdir = $(gimpdatadir)/fonts
 

Added: trunk/data/tags/Makefile.am
==============================================================================
--- (empty file)
+++ trunk/data/tags/Makefile.am	Tue Feb 17 18:43:32 2009
@@ -0,0 +1,29 @@
+## Makefile.am for gimp/data/tags
+
+tagsdatadir = $(gimpdatadir)/tags
+
+tagsdata_in_files = gimp-tags-default.xml.in
+
+tagsdata_data_files = $(tagsdata_in_files:.xml.in=.xml)
+
+tagsdata_DATA =	$(tagsdata_data_files)
+
+EXTRA_DIST = \
+	$(tagsdata_DATA)	\
+	$(tagsdata_in_files)	\
+	gimp-tags.dtd		
+
+DISTCLEANFILES = $(tagsdata_data_files)
+
+
+gimp-tags-default.xml: gimp-tags-default.xml.in $(wildcard $(top_srcdir)/po-tags/*.po)
+	$(INTLTOOL_MERGE) $(top_srcdir)/po-tags $< $(@) -x -u -c $(top_builddir)/po-tags/.intltool-merge-cache
+
+
+validate: gimp-tags-default.xml
+if HAVE_XMLLINT
+	@$(XMLLINT) --noout --path $(srcdir) --valid $< || \
+	  ( echo "* gimp-tags-default.xml INVALID *"; exit 1; )
+endif
+
+dist-hook: validate

Added: trunk/data/tags/gimp-tags-default.xml.in
==============================================================================
--- (empty file)
+++ trunk/data/tags/gimp-tags-default.xml.in	Tue Feb 17 18:43:32 2009
@@ -0,0 +1,34 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!DOCTYPE tags SYSTEM "gimp-tags.dtd">
+
+<!-- This is a list of default tags for GIMP resources.                    -->
+<!--                                                                       -->
+<!-- Please do not use separator characters, such as comma, in tags.       -->
+
+<tags>
+
+  <resource identifier="gimp-brush-clipboard" checksum="157dcef48665ab465439cfaf10d6feeb">
+    <tag>
+      <_thetag>test1</_thetag>
+    </tag>
+    <tag>
+      <_thetag>test2</_thetag>
+    </tag>
+    <tag>
+      <_thetag>test3</_thetag>
+    </tag>
+  </resource>
+
+  <resource identifier="/home/auris/gimp/trunk/build/share/gimp/2.0/brushes/confetti.gih" checksum="d136b60fdd9cf41693a485a329b32e95">
+    <tag>
+      <_thetag>test4</_thetag>
+    </tag>
+    <tag>
+      <_thetag>test5</_thetag>
+    </tag>
+    <tag>
+      <_thetag>test3</_thetag>
+    </tag>
+  </resource>
+
+</tags>

Added: trunk/data/tags/gimp-tags.dtd
==============================================================================
--- (empty file)
+++ trunk/data/tags/gimp-tags.dtd	Tue Feb 17 18:43:32 2009
@@ -0,0 +1,12 @@
+<!-- Simple DTD for GIMP tips -->
+
+<!ELEMENT tags (resource+)>
+
+<!ELEMENT resource (tag+)>
+<!ATTLIST resource identifier CDATA #REQUIRED>
+<!ATTLIST resource checksum CDATA #IMPLIED>
+
+<!ELEMENT tag (thetag+)>
+
+<!ELEMENT thetag (#PCDATA)>
+<!ATTLIST thetag xml:lang CDATA #IMPLIED>

Added: trunk/po-tags/LINGUAS
==============================================================================
--- (empty file)
+++ trunk/po-tags/LINGUAS	Tue Feb 17 18:43:32 2009
@@ -0,0 +1,3 @@
+# please keep this list sorted alphabetically
+#
+lt

Added: trunk/po-tags/Makefile.in.in
==============================================================================
--- (empty file)
+++ trunk/po-tags/Makefile.in.in	Tue Feb 17 18:43:32 2009
@@ -0,0 +1,220 @@
+# Makefile for program source directory in GNU NLS utilities package.
+# Copyright (C) 1995, 1996, 1997 by Ulrich Drepper <drepper gnu ai mit edu>
+#
+# This file file be copied and used freely without restrictions.  It can
+# be used in projects which are not available under the GNU Public License
+# but which still want to provide support for the GNU gettext functionality.
+# Please note that the actual code is *not* freely available.
+#
+# - Modified by Owen Taylor <otaylor redhat com> to use GETTEXT_PACKAGE
+#   instead of PACKAGE and to look for po2tbl in ./ not in intl/
+#
+# - Modified by jacob berkman <jacob ximian com> to install
+#   Makefile.in.in and po2tbl.sed.in for use with glib-gettextize
+#
+# - Modified by Rodney Dawes <dobey novell com> for use with intltool
+#
+# We have the following line for use by intltoolize:
+# INTLTOOL_MAKEFILE
+
+GETTEXT_PACKAGE = @GETTEXT_PACKAGE -tags
+XGETTEXT_KEYWORDS=--keyword=_ --keyword=N_ --keyword=Q_:1g --keyword=C_:1c,2 --keyword=NC_:1c,2
+
+PACKAGE = @PACKAGE@
+VERSION = @VERSION@
+
+SHELL = /bin/sh
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+top_builddir = @top_builddir@
+VPATH = @srcdir@
+
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+datadir = @datadir@
+datarootdir = @datarootdir@
+libdir = @libdir@
+DATADIRNAME = @DATADIRNAME@
+itlocaledir = $(prefix)/$(DATADIRNAME)/locale
+subdir = po-tags
+install_sh = @install_sh@
+# Automake >= 1.8 provides @mkdir_p  
+# Until it can be supposed, use the safe fallback:
+mkdir_p = $(install_sh) -d
+
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+
+GMSGFMT = @GMSGFMT@
+MSGFMT = @MSGFMT@
+XGETTEXT = @XGETTEXT@
+INTLTOOL_UPDATE = @INTLTOOL_UPDATE@
+INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@
+MSGMERGE = INTLTOOL_EXTRACT=$(INTLTOOL_EXTRACT) srcdir=$(srcdir) $(INTLTOOL_UPDATE) --gettext-package $(GETTEXT_PACKAGE) --dist
+GENPOT   = INTLTOOL_EXTRACT=$(INTLTOOL_EXTRACT) srcdir=$(srcdir) $(INTLTOOL_UPDATE) --gettext-package $(GETTEXT_PACKAGE) --pot
+
+ALL_LINGUAS = @ALL_LINGUAS@
+
+PO_LINGUAS=$(shell if test -r $(srcdir)/LINGUAS; then grep -v "^\#" $(srcdir)/LINGUAS; fi)
+
+USER_LINGUAS=$(shell if test -n "$(LINGUAS)"; then LLINGUAS="$(LINGUAS)"; ALINGUAS="$(ALL_LINGUAS)"; for lang in $$LLINGUAS; do if test -n "`grep ^$$lang$$ $(srcdir)/LINGUAS`" -o -n "`echo $$ALINGUAS|grep ' ?$$lang ?'`"; then printf "$$lang "; fi; done; fi)
+
+USE_LINGUAS=$(shell if test -n "$(USER_LINGUAS)"; then LLINGUAS="$(USER_LINGUAS)"; else if test -n "$(PO_LINGUAS)"; then LLINGUAS="$(PO_LINGUAS)"; else LLINGUAS="$(ALL_LINGUAS)"; fi; fi; for lang in $$LLINGUAS; do printf "$$lang "; done)
+
+POFILES=$(shell LINGUAS="$(USE_LINGUAS)"; for lang in $$LINGUAS; do printf "$$lang.po "; done)
+
+DISTFILES = ChangeLog Makefile.in.in POTFILES.in $(POFILES)
+EXTRA_DISTFILES = POTFILES.skip Makevars LINGUAS
+
+POTFILES = \
+# This comment gets stripped out
+
+CATALOGS=$(shell LINGUAS="$(USE_LINGUAS)"; for lang in $$LINGUAS; do printf "$$lang.gmo "; done)
+
+.SUFFIXES:
+.SUFFIXES: .po .pox .gmo .mo .msg .cat
+
+.po.pox:
+	$(MAKE) $(GETTEXT_PACKAGE).pot
+	$(MSGMERGE) $< $(GETTEXT_PACKAGE).pot -o $*.pox
+
+.po.mo:
+	$(MSGFMT) -o $@ $<
+
+.po.gmo:
+	file=`echo $* | sed 's,.*/,,'`.gmo \
+	  && rm -f $$file && $(GMSGFMT) -o $$file $<
+
+.po.cat:
+	sed -f ../intl/po2msg.sed < $< > $*.msg \
+	  && rm -f $@ && gencat $@ $*.msg
+
+
+all: all- USE_NLS@
+
+all-yes: $(CATALOGS)
+all-no:
+
+$(GETTEXT_PACKAGE).pot: $(POTFILES)
+	$(GENPOT)
+
+install: install-data
+install-data: install-data- USE_NLS@
+install-data-no: all
+install-data-yes: all
+	$(mkdir_p) $(DESTDIR)$(itlocaledir)
+	linguas="$(USE_LINGUAS)"; \
+	for lang in $$linguas; do \
+	  dir=$(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES; \
+	  $(mkdir_p) $$dir; \
+	  if test -r $$lang.gmo; then \
+	    $(INSTALL_DATA) $$lang.gmo $$dir/$(GETTEXT_PACKAGE).mo; \
+	    echo "installing $$lang.gmo as $$dir/$(GETTEXT_PACKAGE).mo"; \
+	  else \
+	    $(INSTALL_DATA) $(srcdir)/$$lang.gmo $$dir/$(GETTEXT_PACKAGE).mo; \
+	    echo "installing $(srcdir)/$$lang.gmo as" \
+		 "$$dir/$(GETTEXT_PACKAGE).mo"; \
+	  fi; \
+	  if test -r $$lang.gmo.m; then \
+	    $(INSTALL_DATA) $$lang.gmo.m $$dir/$(GETTEXT_PACKAGE).mo.m; \
+	    echo "installing $$lang.gmo.m as $$dir/$(GETTEXT_PACKAGE).mo.m"; \
+	  else \
+	    if test -r $(srcdir)/$$lang.gmo.m ; then \
+	      $(INSTALL_DATA) $(srcdir)/$$lang.gmo.m \
+		$$dir/$(GETTEXT_PACKAGE).mo.m; \
+	      echo "installing $(srcdir)/$$lang.gmo.m as" \
+		   "$$dir/$(GETTEXT_PACKAGE).mo.m"; \
+	    else \
+	      true; \
+	    fi; \
+	  fi; \
+	done
+
+# Empty stubs to satisfy archaic automake needs
+dvi info tags TAGS ID:
+
+# Define this as empty until I found a useful application.
+install-exec installcheck:
+
+uninstall:
+	linguas="$(USE_LINGUAS)"; \
+	for lang in $$linguas; do \
+	  rm -f $(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE).mo; \
+	  rm -f $(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE).mo.m; \
+	done
+
+check: all $(GETTEXT_PACKAGE).pot
+	rm -f missing notexist
+	srcdir=$(srcdir) $(INTLTOOL_UPDATE) -m
+	if [ -r missing -o -r notexist ]; then \
+	  exit 1; \
+	fi
+
+mostlyclean:
+	rm -f *.pox $(GETTEXT_PACKAGE).pot *.old.po cat-id-tbl.tmp
+	rm -f .intltool-merge-cache
+
+clean: mostlyclean
+
+distclean: clean
+	rm -f Makefile Makefile.in POTFILES stamp-it
+	rm -f *.mo *.msg *.cat *.cat.m *.gmo
+
+maintainer-clean: distclean
+	@echo "This command is intended for maintainers to use;"
+	@echo "it deletes files that may require special tools to rebuild."
+	rm -f Makefile.in.in
+
+distdir = ../$(PACKAGE)-$(VERSION)/$(subdir)
+dist distdir: $(DISTFILES)
+	dists="$(DISTFILES)"; \
+	extra_dists="$(EXTRA_DISTFILES)"; \
+	for file in $$extra_dists; do \
+	  test -f $(srcdir)/$$file && dists="$$dists $(srcdir)/$$file"; \
+	done; \
+	for file in $$dists; do \
+	  test -f $$file || file="$(srcdir)/$$file"; \
+	  ln $$file $(distdir) 2> /dev/null \
+	    || cp -p $$file $(distdir); \
+	done
+
+update-po: Makefile
+	$(MAKE) $(GETTEXT_PACKAGE).pot
+	tmpdir=`pwd`; \
+	linguas="$(USE_LINGUAS)"; \
+	for lang in $$linguas; do \
+	  echo "$$lang:"; \
+	  result="`$(MSGMERGE) -o $$tmpdir/$$lang.new.po $$lang`"; \
+	  if $$result; then \
+	    if cmp $(srcdir)/$$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \
+	      rm -f $$tmpdir/$$lang.new.po; \
+            else \
+	      if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \
+	        :; \
+	      else \
+	        echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \
+	        rm -f $$tmpdir/$$lang.new.po; \
+	        exit 1; \
+	      fi; \
+	    fi; \
+	  else \
+	    echo "msgmerge for $$lang.gmo failed!"; \
+	    rm -f $$tmpdir/$$lang.new.po; \
+	  fi; \
+	done
+
+Makefile POTFILES: stamp-it
+	@if test ! -f $@; then \
+	  rm -f stamp-it; \
+	  $(MAKE) stamp-it; \
+	fi
+
+stamp-it: Makefile.in.in $(top_builddir)/config.status POTFILES.in
+	cd $(top_builddir) \
+	  && CONFIG_FILES=$(subdir)/Makefile.in CONFIG_HEADERS= CONFIG_LINKS= \
+	       $(SHELL) ./config.status
+
+# Tell versions [3.59,3.63) of GNU make not to export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:

Added: trunk/po-tags/POTFILES.in
==============================================================================
--- (empty file)
+++ trunk/po-tags/POTFILES.in	Tue Feb 17 18:43:32 2009
@@ -0,0 +1,6 @@
+# Files from the Gimp distribution which have already been
+# marked to allow runtime translation of messages
+
+[encoding: UTF-8]
+
+data/tags/gimp-tags-default.xml.in

Added: trunk/po-tags/POTFILES.skip
==============================================================================
--- (empty file)
+++ trunk/po-tags/POTFILES.skip	Tue Feb 17 18:43:32 2009
@@ -0,0 +1,12 @@
+app
+desktop
+desktop/gimp.desktop.in
+libgimp
+libgimpbase
+libgimpconfig
+libgimpmodule
+libgimpthumb
+libgimpwidgets
+modules
+plug-ins
+tools



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