[passepartout] started translatability



commit 5e254cd3db79e9694e01c96004eb0493f402b6e3
Author: Sven Herzberg <herzi src gnome org>
Date:   Wed Apr 8 19:25:04 2009 +0000

    started translatability
    
    * autogen.sh: fixed support for srcdir!=builddir invocations
    * configure.ac: added intltool and glib-gettext dependencies; depend on glibmm
      2.16 for Glib::ustring::compose()
    * Makefile.am: added passepartout.desktop to the installed files
    * passepartout.desktop -> passepartout.desktop.in: renamed and changed for
      translatability
    * po/LINGUAS: added a list of German and Swedish
    * po/POTFILES.in: added some files to be translated
    * po/de.po: initial German translation
    * po/sv.po: initial Swedish translation (with the one message from the .desktop
      file)
    * src/pptout/main.cc: made the help messages translatable
    
    git-svn-id: http://svn.gnome.org/svn/passepartout/trunk 1533 910bfebc-b532-0410-a802-fb3981afa09c
---
 Makefile.am             |   14 ++++++++++++--
 autogen.sh              |    2 +-
 configure.ac            |   27 ++++++++++++++++++++++++++-
 passepartout.desktop    |    9 ---------
 passepartout.desktop.in |    9 +++++++++
 po/LINGUAS              |    3 +++
 po/POTFILES.in          |    2 ++
 po/de.po                |   39 +++++++++++++++++++++++++++++++++++++++
 po/sv.po                |   41 +++++++++++++++++++++++++++++++++++++++++
 src/pptout/main.cc      |   19 ++++++++++++++-----
 10 files changed, 147 insertions(+), 18 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 22ed035..dd59eb8 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,3 +1,13 @@
-SUBDIRS = src doc logotype
+SUBDIRS=\
+       src \
+       doc \
+       logotype \
+       po \
+       $(NULL)
 
-EXTRA_DIST = BUGS Doxyfile
+dist_applications_in_files=passepartout.desktop.in
+applications_DATA=$(dist_applications_in_files:.in=)
+applicationsdir=$(datarootdir)/applications
+ INTLTOOL_DESKTOP_RULE@
+
+EXTRA_DIST = Doxyfile
diff --git a/autogen.sh b/autogen.sh
index 039af02..880615d 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -35,4 +35,4 @@ fi
 
 NOCONFIGURE="yes" GNOME_DATADIR="$gnome_datadir" USE_GNOME2_MACROS=1 . $gnome_autogen
 
-$srcdir/configure --enable-maintainer-mode `/bin/grep ^DISTCHECK configure.ac | sed 's/^DISTCHECK_CONFIGURE_FLAGS="\(.*\)"$/\1/'` $@
+$srcdir/configure --enable-maintainer-mode `/bin/grep ^DISTCHECK "$srcdir/configure.ac" | sed 's/^DISTCHECK_CONFIGURE_FLAGS="\(.*\)"$/\1/'` $@
diff --git a/configure.ac b/configure.ac
index 9af816e..304fa5c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -35,7 +35,7 @@ AC_APPLY_RPATH([XMLPP_LIBS])
 
 AC_SUBST([GTKMM_LIBS])
 AC_SUBST([GTKMM_CFLAGS])
-PKG_CHECK_MODULES(GTKMM, gtkmm-2.4)
+PKG_CHECK_MODULES(GTKMM,[glibmm-2.4 >= 2.16 gtkmm-2.4])
 AC_APPLY_RPATH([GTKMM_LIBS])
 
 AC_SUBST([GNOMECANVAS_LIBS])
@@ -87,6 +87,31 @@ AC_FUNC_FORK
 AC_FUNC_STAT
 AC_CHECK_FUNCS([realpath strdup mkdtemp])
 
+dnl  ------
+dnl | i18n |
+dnl  ------
+
+IT_PROG_INTLTOOL
+AM_GLIB_GNU_GETTEXT
+
+GETTEXT_PACKAGE="passepartout"
+AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"${GETTEXT_PACKAGE}",[the package name for gettext])
+AC_SUBST(GETTEXT_PACKAGE)
+
+if test "x${prefix}" = "xNONE"; then
+        PACKAGE_LOCALE_DIR="${ac_default_prefix}"
+else
+        PACKAGE_LOCALE_DIR="${prefix}"
+fi
+PACKAGE_LOCALE_DIR="${PACKAGE_LOCALE_DIR}/${DATADIRNAME}/locale"
+AC_DEFINE_UNQUOTED(PACKAGE_LOCALE_DIR,"${PACKAGE_LOCALE_DIR}",[the package's locale path for gettext])
+
+AC_CONFIG_FILES([po/Makefile.in po/POTFILES])
+
+dnl  --------
+dnl | output |
+dnl  --------
+
 AC_CONFIG_FILES([Makefile
 	         src/Makefile	
                  src/ps/Makefile
diff --git a/passepartout.desktop b/passepartout.desktop
deleted file mode 100644
index 85495da..0000000
--- a/passepartout.desktop
+++ /dev/null
@@ -1,9 +0,0 @@
-[Desktop Entry]
-Name=Passepartout
-Comment=Desktop publishing application
-Comment[sv]=Layoutprogram
-Icon=pptout-icon.png
-Exec=passepartout
-Terminal=false
-Type=Application
-Categories=Application;Office;
diff --git a/passepartout.desktop.in b/passepartout.desktop.in
new file mode 100644
index 0000000..fd14b97
--- /dev/null
+++ b/passepartout.desktop.in
@@ -0,0 +1,9 @@
+[Desktop Entry]
+_Name=Passepartout
+_GenericName=Desktop publishing application
+_Comment=Desktop publishing application
+Icon=pptout-icon.png
+Exec=passepartout
+Terminal=false
+Type=Application
+Categories=Application;Office;
diff --git a/po/LINGUAS b/po/LINGUAS
new file mode 100644
index 0000000..f4189b8
--- /dev/null
+++ b/po/LINGUAS
@@ -0,0 +1,3 @@
+# keep the alphabetically sorted, please
+de
+sv
diff --git a/po/POTFILES.in b/po/POTFILES.in
new file mode 100644
index 0000000..f3c54ac
--- /dev/null
+++ b/po/POTFILES.in
@@ -0,0 +1,2 @@
+passepartout.desktop.in
+src/pptout/main.cc
diff --git a/po/de.po b/po/de.po
new file mode 100644
index 0000000..c274b35
--- /dev/null
+++ b/po/de.po
@@ -0,0 +1,39 @@
+# German Translation of Passepartout.
+# Copyright (C) 2009 Sven Herzberg
+# This file is distributed under the same license as the passepartout package.
+# Sven Herzberg <herzi gnome org>, 2009.
+# , fuzzy
+#
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: passepartout 0.7.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2009-04-08 15:26+0200\n"
+"PO-Revision-Date: 2009-04-08 15:31+0200\n"
+"Last-Translator: Sven Herzberg <herzi gnome-de org>\n"
+"Language-Team: German <gnome-de gnome org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit"
+
+#: ../src/pptout/main.cc:58
+msgid "Show version number"
+msgstr "Zeige die verwendete Versionsnummer an"
+
+#: ../src/pptout/main.cc:61
+msgid "Be verbose"
+msgstr "Ausführlich sein"
+
+#: ../src/pptout/main.cc:64
+msgid "Show debugging messages"
+msgstr "Zeige Diagnoseausgaben"
+
+#: ../src/pptout/main.cc:68
+msgid "Show this help message"
+msgstr "Zeige diesen Hilfetext"
+
+#: ../src/pptout/main.cc:93
+msgid "Usage: passepartout [options] [files...]"
+msgstr "Aufruf: passepartout [Optionen] [Dateien...]"
+
diff --git a/po/sv.po b/po/sv.po
new file mode 100644
index 0000000..08cf75f
--- /dev/null
+++ b/po/sv.po
@@ -0,0 +1,41 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2009-04-08 15:33+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL ADDRESS>\n"
+"Language-Team: LANGUAGE <LL li org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: ../src/pptout/main.cc:58
+msgid "Show version number"
+msgstr ""
+
+#: ../src/pptout/main.cc:61
+msgid "Be verbose"
+msgstr ""
+
+#: ../src/pptout/main.cc:64
+msgid "Show debugging messages"
+msgstr ""
+
+#: ../src/pptout/main.cc:68
+msgid "Show this help message"
+msgstr ""
+
+#: ../src/pptout/main.cc:93
+msgid "Usage: passepartout [options] [files...]"
+msgstr ""
+
+msgid "Desktop publishing application"
+msgstr "Layoutprogram"
+
diff --git a/src/pptout/main.cc b/src/pptout/main.cc
index 5165c91..1672307 100644
--- a/src/pptout/main.cc
+++ b/src/pptout/main.cc
@@ -15,6 +15,8 @@
 #include "icons/icon_48.h"
 #include "stockitems.h"
 
+#include <glib/gi18n.h>
+
 int main(int argc, char *argv[]) {
   try {
     init_exception_handler();
@@ -23,6 +25,13 @@ int main(int argc, char *argv[]) {
     // set prefix for temp files
     Tempfile::set_prefix("pptout");
 
+#ifdef ENABLE_NLS
+    /* initialize i18n */
+    bindtextdomain (GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR);
+    bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
+    textdomain (GETTEXT_PACKAGE);
+#endif
+
     // initialize threads
     Glib::thread_init();
 
@@ -46,17 +55,17 @@ int main(int argc, char *argv[]) {
     const int o_version =
       cmdline.add_option(CmdLine::Option('v', "version",
 					 CmdLine::Option::NO_PARAM, 
-					 "Show version number"));
+					 _("Show version number")));
     const int o_verbose = 
       cmdline.add_option(CmdLine::Option('V', "", CmdLine::Option::NO_PARAM, 
-					 "Be verbose"));
+					 _("Be verbose")));
     const int o_debug = 
       cmdline.add_option(CmdLine::Option('d', "", CmdLine::Option::NO_PARAM, 
-					 "Show debugging messages"));
+					 _("Show debugging messages")));
     const int o_help =
       cmdline.add_option(CmdLine::Option('h', "help",
 					 CmdLine::Option::NO_PARAM,
-					 "Show this help message"));
+					 _("Show this help message")));
     CmdLine::ParsedOptions opts = cmdline.parse();
     for(CmdLine::ParsedOptions::const_iterator
 	  arg = opts.begin(); arg != opts.end(); arg++) {
@@ -81,7 +90,7 @@ int main(int argc, char *argv[]) {
 	debug.active = true;
 	debug << "Debug mode active" << std::endl; // Why wait?
       } else if(option == o_help) {
-	std::cout << "Usage: passepartout [options] [files...]" << std::endl;
+	std::cout << _("Usage: passepartout [options] [files...]") << std::endl;
 	cmdline.print_usage(std::cout);
 	return 0;
       }



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