[hotssh] Add translation infrastructure



commit 60748b70644288e2d2825742450732f953b435d6
Author: Colin Walters <walters verbum org>
Date:   Tue Nov 26 17:41:43 2013 -0500

    Add translation infrastructure

 Makefile-src.am  |    1 +
 autogen.sh       |   42 +++++++++-----------
 configure.ac     |    6 +++
 po/LINGUAS       |    1 +
 po/POTFILES.in   |    7 +++
 po/fr.po         |  113 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 src/hotssh-win.c |    4 +-
 src/main.c       |    5 ++
 8 files changed, 155 insertions(+), 24 deletions(-)
---
diff --git a/Makefile-src.am b/Makefile-src.am
index c3318ee..582f81c 100644
--- a/Makefile-src.am
+++ b/Makefile-src.am
@@ -36,6 +36,7 @@ hotssh_SOURCES = $(hotssh_headers) \
        src/hotssh-prefs.c \
        $(NULL)
 
+hotssh_CPPFLAGS = $(AM_CPPFLAGS) -DLOCALEDIR=\"$(localedir)\"
 hotssh_CFLAGS = $(AM_CFLAGS) $(BUILDDEP_HOTSSHAPP_CFLAGS) -I$(srcdir)/libgsystem -I$(srcdir)/libgssh 
-I$(srcdir)/src
 hotssh_LDADD = $(BUILDDEP_HOTSSHAPP_LIBS) libgssh.la libgsystem.la
 
diff --git a/autogen.sh b/autogen.sh
index e217ae4..1a7ab51 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -1,30 +1,26 @@
 #!/bin/sh
+# Run this to generate all the initial makefiles, etc.
 
-test -n "$srcdir" || srcdir=`dirname "$0"`
-test -n "$srcdir" || srcdir=.
+srcdir=`dirname $0`
+test -z "$srcdir" && srcdir=.
 
-olddir=`pwd`
-cd $srcdir
+PKG_NAME="hotssh"
 
-AUTORECONF=`which autoreconf`
-if test -z $AUTORECONF; then
-        echo "*** No autoreconf found, please intall it ***"
-        exit 1
-fi
+(test -f $srcdir/src/hotssh-app.c) || {
+    echo -n "**Error**: Directory "\`$srcdir\'" does not look like the"
+    echo " top-level $PKG_NAME directory"
+    exit 1
+}
 
-set -e
+which gnome-autogen.sh || {
+    echo "You need to install gnome-common from the GNOME git"
+    exit 1
+}
 
-mkdir -p m4
+git submodule update --init --recursive
 
-# Fetch submodules if needed
-if test ! -f libgsystem/README;
-then
-  echo "+ Setting up submodules"
-  git submodule init
-  git submodule update
-fi
-
-autoreconf --force --install --verbose
-
-cd $olddir
-test -n "$NOCONFIGURE" || "$srcdir/configure" "$@"
+REQUIRED_AUTOCONF_VERSION=2.59
+REQUIRED_AUTOMAKE_VERSION=1.9
+REQUIRED_INTLTOOL_VERSION=0.40.0
+REQUIRED_PKG_CONFIG_VERSION=0.22
+. gnome-autogen.sh
diff --git a/configure.ac b/configure.ac
index 93baab6..191e89a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -13,6 +13,11 @@ AC_SYS_LARGEFILE
 AC_PROG_CC
 AM_PROG_CC_C_O
 
+GETTEXT_PACKAGE=AC_PACKAGE_NAME
+AC_SUBST(GETTEXT_PACKAGE)
+AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE",[The name of the gettext domain])
+IT_PROG_INTLTOOL(0.50.1)
+
 changequote(,)dnl
 if test "x$GCC" = "xyes"; then
   WARN_CFLAGS="-Wall -Wstrict-prototypes -Werror=missing-prototypes \
@@ -42,5 +47,6 @@ LIBS=$save_LIBS
 
 AC_CONFIG_FILES([
 Makefile
+po/Makefile.in
 ])
 AC_OUTPUT
diff --git a/po/LINGUAS b/po/LINGUAS
new file mode 100644
index 0000000..527e861
--- /dev/null
+++ b/po/LINGUAS
@@ -0,0 +1 @@
+fr
diff --git a/po/POTFILES.in b/po/POTFILES.in
new file mode 100644
index 0000000..bc9d8d6
--- /dev/null
+++ b/po/POTFILES.in
@@ -0,0 +1,7 @@
+[encoding: UTF-8]
+src/hotssh-win.c
+[type: gettext/glade]src/app-menu.ui
+[type: gettext/glade]src/gears-menu.ui
+[type: gettext/glade]src/prefs.ui
+[type: gettext/glade]src/tab.ui
+[type: gettext/glade]src/window.ui
diff --git a/po/POTFILES.skip b/po/POTFILES.skip
new file mode 100644
index 0000000..e69de29
diff --git a/po/fr.po b/po/fr.po
new file mode 100644
index 0000000..ac01c03
--- /dev/null
+++ b/po/fr.po
@@ -0,0 +1,113 @@
+# French translation for hotssh
+# Copyright (C) 2013 hotssh's COPYRIGHT HOLDER
+# This file is distributed under the same license as the hotssh package.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: hotssh master\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2013-11-26 17:23-0500\n"
+"PO-Revision-Date: 2013-09-14 19:16+0200\n"
+"Last-Translator: Colin Walters <walters verbum org>\n"
+"Language-Team: GNOME French Team <gnomefr traduc org>\n"
+"Language: fr\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=(n > 1);\n"
+
+#: ../src/hotssh-win.c:144
+msgid "Disconnected"
+msgstr "Déconnecté"
+
+#: ../src/app-menu.ui.h:1
+msgid "_Preferences"
+msgstr ""
+
+#: ../src/app-menu.ui.h:2
+msgid "_Quit"
+msgstr "Fermer"
+
+#: ../src/gears-menu.ui.h:1
+msgid "_New Tab"
+msgstr ""
+
+#: ../src/gears-menu.ui.h:2
+msgid "_Disconnect"
+msgstr ""
+
+#: ../src/prefs.ui.h:1
+msgid "Preferences"
+msgstr ""
+
+#: ../src/tab.ui.h:1
+msgid "Host: "
+msgstr ""
+
+#: ../src/tab.ui.h:2
+msgid "Username: "
+msgstr ""
+
+#: ../src/tab.ui.h:3
+msgid "_Connect"
+msgstr ""
+
+#: ../src/tab.ui.h:4
+msgid "Host"
+msgstr ""
+
+#: ../src/tab.ui.h:5
+msgid "Connecting..."
+msgstr ""
+
+#: ../src/tab.ui.h:6
+msgid "Status"
+msgstr ""
+
+#: ../src/tab.ui.h:7
+msgid "Error:"
+msgstr ""
+
+#: ../src/tab.ui.h:8
+msgid "Disconnect"
+msgstr ""
+
+#: ../src/tab.ui.h:9
+msgid "Error"
+msgstr ""
+
+#: ../src/tab.ui.h:10
+msgid "Approval of newly seen host key required; RSA key fingerprint is:"
+msgstr ""
+
+#: ../src/tab.ui.h:11
+msgid "00:--:--:--:--:--:--:--:--:--:--:--:--:--:--:00"
+msgstr ""
+
+#: ../src/tab.ui.h:12
+msgid "Approve and Connect"
+msgstr ""
+
+#: ../src/tab.ui.h:13
+msgid "Hostkey"
+msgstr ""
+
+#: ../src/tab.ui.h:14
+msgid "Password:"
+msgstr ""
+
+#: ../src/tab.ui.h:15
+msgid "Password"
+msgstr ""
+
+#: ../src/tab.ui.h:16
+msgid "Terminal"
+msgstr ""
+
+#: ../src/window.ui.h:1
+msgid "HotSSH"
+msgstr ""
+
+#: ../src/window.ui.h:2
+msgid "New Connection"
+msgstr ""
diff --git a/src/hotssh-win.c b/src/hotssh-win.c
index e564106..789039f 100644
--- a/src/hotssh-win.c
+++ b/src/hotssh-win.c
@@ -23,6 +23,8 @@
 
 #include "libgsystem.h"
 
+#include <glib/gi18n.h>
+
 static void hotssh_win_append_tab (HotSshWindow   *self, gboolean new_channel);
 static void new_tab_activated (GSimpleAction    *action,
                                GVariant         *parameter,
@@ -139,7 +141,7 @@ on_tab_hostname_changed (HotSshTab           *tab,
   GtkWidget *label_box = gtk_notebook_get_tab_label ((GtkNotebook*)priv->main_notebook, (GtkWidget*)tab);
   GtkLabel *real_label = GTK_LABEL (g_object_get_data ((GObject*)label_box, "label-text"));
   const char *hostname = hotssh_tab_get_hostname (tab);
-  gtk_label_set_text (real_label, hostname ? hostname : "Disconnected");
+  gtk_label_set_text (real_label, hostname ? hostname : _("Disconnected"));
 }
 
 static void
diff --git a/src/main.c b/src/main.c
index 62cfce6..375cca9 100644
--- a/src/main.c
+++ b/src/main.c
@@ -21,8 +21,13 @@
 #include <gtk/gtk.h>
 #include <hotssh-app.h>
 
+#include <glib/gi18n.h>
+
 int
 main (int argc, char *argv[])
 {
+  bindtextdomain ("hotssh", LOCALEDIR);
+  bind_textdomain_codeset ("hotssh", "UTF-8");
+  textdomain ("hotssh");
   return g_application_run (G_APPLICATION (hotssh_app_new ()), argc, argv);
 }


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