From 37199f0fd28d5f036d99d4755544ffa90436b600 Mon Sep 17 00:00:00 2001 From: Sebastian Droege Date: Thu, 6 Oct 2005 14:41:58 +0000 Subject: * added localization to sda git-svn-id: file:///home/lennart/svn/public/service-discovery-applet/trunk@45 3be567f1-68ff-0310-b24a-ad7cc433fd2f --- Makefile.am | 7 +- actions/services/Makefile.am | 2 + actions/services/__init__.py.in | 26 ++- configure.ac | 16 ++ po/ChangeLog | 0 po/POTFILES.in | 11 ++ po/de.po | 246 +++++++++++++++++++++++++ po/service-discovery-applet.pot | 236 ++++++++++++++++++++++++ schemas/Makefile.am | 10 +- schemas/service-discovery-applet.schemas | 41 ----- schemas/service-discovery-applet.schemas.in | 41 +++++ servers/GNOME_ServiceDiscoveryApplet.server.in | 8 +- servers/Makefile.am | 10 +- src/Makefile.am | 4 + src/service-discovery-applet.in | 50 ++--- src/service-discovery-config.glade | 8 +- src/service-discovery-config.in | 15 +- 17 files changed, 637 insertions(+), 94 deletions(-) create mode 100644 po/ChangeLog create mode 100644 po/POTFILES.in create mode 100644 po/de.po create mode 100644 po/service-discovery-applet.pot delete mode 100644 schemas/service-discovery-applet.schemas create mode 100644 schemas/service-discovery-applet.schemas.in diff --git a/Makefile.am b/Makefile.am index 2d0cd8c..509188f 100644 --- a/Makefile.am +++ b/Makefile.am @@ -4,6 +4,9 @@ SUBDIRS = \ icons \ schemas \ actions \ - servers + servers \ + po -EXTRA_DIST = README INSTALL AUTHORS COPYING TODO +EXTRA_DIST = README INSTALL AUTHORS COPYING TODO \ + intltool-extract.in intltool-merge.in intltool-update.in +DISTCLEANFILES = intltool-extract intltool-merge intltool-update diff --git a/actions/services/Makefile.am b/actions/services/Makefile.am index d90fa28..651a31e 100644 --- a/actions/services/Makefile.am +++ b/actions/services/Makefile.am @@ -5,6 +5,8 @@ services_SCRIPTS = \ __init__.py: __init__.py.in sed \ -e 's,@PYTHON\@,$(PYTHON),g' \ + -e 's,@GETTEXT_PACKAGE\@,$(GETTEXT_PACKAGE),g' \ + -e 's,@LOCALEDIR\@,$(LOCALEDIR),g' \ $< > $@ chmod +x $@ diff --git a/actions/services/__init__.py.in b/actions/services/__init__.py.in index 0fc81bd..df6a8b4 100755 --- a/actions/services/__init__.py.in +++ b/actions/services/__init__.py.in @@ -18,13 +18,21 @@ # it will hopefully appear in 0.3 # this file is just an interim solution to give the same functionnaly as 0.1 -import pygtk -pygtk.require('2.0') -import gtk -import os -import pwd -import subprocess -import gnome +try: + import gettext + gettext.bindtextdomain("@GETTEXT_PACKAGE@", "@LOCALEDIR@") + gettext.textdomain("@GETTEXT_PACKAGE@") + gettext.install("@GETTEXT_PACKAGE@", unicode=1) + import pygtk + pygtk.require('2.0') + import gtk + import os + import pwd + import subprocess + import gnome +except ImportError, e: + error_msg(_("A python module is missing.\n%s") % (e)) + sys.exit() def pair_to_dict(l): res = dict() @@ -96,7 +104,7 @@ def enter_callback(widget, win): def SshLogin(hostname, username = None): global win - win = gtk.Dialog("Ssh Connection", None, + win = gtk.Dialog(_("SSH Connection"), None, gtk.DIALOG_MODAL, (gtk.STOCK_OK, gtk.RESPONSE_OK)) @@ -105,7 +113,7 @@ def SshLogin(hostname, username = None): vbox.set_border_width(5) label = gtk.Label() - label.set_markup("Connecting to %s.\nPlease enter your login:" % (hostname)) + label.set_markup(_("Connecting to %s.\nPlease enter your login:") % (hostname)) vbox.pack_start(label, False, False, 0) diff --git a/configure.ac b/configure.ac index df2fa4a..c914f22 100644 --- a/configure.ac +++ b/configure.ac @@ -4,6 +4,8 @@ AC_CONFIG_SRCDIR([src/service-discovery-applet.in]) AM_INIT_AUTOMAKE([foreign 1.9 -Wall]) AC_CONFIG_MACRO_DIR([common]) +AC_PROG_INTLTOOL([0.21]) + AC_SUBST(VERSION) AM_MAINTAINER_MODE @@ -41,6 +43,19 @@ dnl This is to check correct gconf installation dnl ======================================================== AM_GCONF_SOURCE_2 +dnl ======================================================== +dnl This is for gettext support +dnl ======================================================== +GETTEXT_PACKAGE=service-discovery-applet +AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Gettext package]) +AC_SUBST(GETTEXT_PACKAGE) +ALL_LINGUAS="de" +AM_GLIB_GNU_GETTEXT + +AM_GLIB_DEFINE_LOCALEDIR([LOCALEDIR]) +LOCALEDIR=$localedir +AC_SUBST(LOCALEDIR) + dnl ======================================================== AC_CONFIG_FILES([ Makefile @@ -53,6 +68,7 @@ AC_CONFIG_FILES([ actions/Makefile actions/services/Makefile src/Makefile + po/Makefile.in ]) AC_OUTPUT diff --git a/po/ChangeLog b/po/ChangeLog new file mode 100644 index 0000000..e69de29 diff --git a/po/POTFILES.in b/po/POTFILES.in new file mode 100644 index 0000000..1565f6b --- /dev/null +++ b/po/POTFILES.in @@ -0,0 +1,11 @@ +[encoding: UTF-8] +# List of source files containing translatable strings. +# Please keep this file sorted alphabetically. + +actions/services/__init__.py.in +schemas/service-discovery-applet.schemas.in +servers/GNOME_ServiceDiscoveryApplet.server.in +src/service-discovery-applet.in +src/service-discovery-config.glade +src/service-discovery-config.in + diff --git a/po/de.po b/po/de.po new file mode 100644 index 0000000..f414cf5 --- /dev/null +++ b/po/de.po @@ -0,0 +1,246 @@ +# German translation for the service-discovery-applet +# Copyright (C) 2005 Sebastian Dröge +# This file is distributed under the same license as the service-discovery-applet package. +# Sebastian Dröge , 2005. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: service-discovery-applet 0.2\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2005-10-06 15:33+0200\n" +"PO-Revision-Date: 2005-10-05 16:13+0200\n" +"Last-Translator: Sebastian Dröge \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" + +#: ../actions/services/__init__.py.in:34 ../src/service-discovery-applet.in:49 +#: ../src/service-discovery-config.in:39 +#, c-format, python-format +msgid "" +"A python module is missing.\n" +"%s" +msgstr "" +"Ein Python Modul fehlt.\n" +"%s" + +#: ../actions/services/__init__.py.in:107 +msgid "SSH Connection" +msgstr "SSH Verbindung" + +#: ../actions/services/__init__.py.in:116 +#, python-format +msgid "" +"Connecting to %s.\n" +"Please enter your login:" +msgstr "" +"Verbinde zu %s.\n" +"Bitte geben Sie ihren Benutzernamen ein:" + +#: ../schemas/service-discovery-applet.schemas.in.h:1 +msgid "Browse for your own services." +msgstr "Durchsuche Dienste auf diesem Rechner" + +#: ../schemas/service-discovery-applet.schemas.in.h:2 +#: ../src/service-discovery-config.glade.h:5 +msgid "Display notifications." +msgstr "Zeige Benachrichtigungen." + +#: ../schemas/service-discovery-applet.schemas.in.h:3 +msgid "First time you start the app?" +msgstr "Erstes Mal, dass das Applet gestartet wird" + +#: ../schemas/service-discovery-applet.schemas.in.h:4 +msgid "" +"Use the notification deamon to notify the user when a service is discovered." +msgstr "" +"Benutze den Benachrichtigungsdaemon zum Benachrichtigen ob ein Dienst " +"entdeckt wurde." + +#: ../servers/GNOME_ServiceDiscoveryApplet.server.in.h:1 +msgid "" +"This applet allow you to quickly access the zeroconf services available on " +"your network." +msgstr "" +"Zeigt Zeroconf Dienste die in dem lokalen Netz verfügbar sind und erlaubt " +"darauf zuzugreifen." + +#: ../servers/GNOME_ServiceDiscoveryApplet.server.in.h:2 +msgid "Zeroconf service discovery applet" +msgstr "Zeroconf Dienstsuche" + +#: ../src/service-discovery-applet.in:123 +msgid "About" +msgstr "_Über" + +#: ../src/service-discovery-applet.in:123 +msgid "_Config" +msgstr "_Einstellungen" + +#: ../src/service-discovery-applet.in:123 +msgid "_Start" +msgstr "_Start" + +#: ../src/service-discovery-applet.in:123 +msgid "_Stop" +msgstr "S_top" + +#: ../src/service-discovery-applet.in:148 +msgid "start notifying" +msgstr "starte Benachrichtigungen" + +#: ../src/service-discovery-applet.in:158 +#, c-format +msgid "Service data for service '%s' of type '%s' in domain '%s' on %s.%i:" +msgstr "Dienstdaten für Dienst '%s' vom Typ '%s' in Domain '%s' auf %s.%i:" + +#: ../src/service-discovery-applet.in:159 +#, c-format +msgid "\tHost %s (%s), port %i, TXT data: %s" +msgstr "\tHost %s (%s), port %i, TXT data: %s" + +#: ../src/service-discovery-applet.in:166 +msgid "Error:" +msgstr "Fehler:" + +#: ../src/service-discovery-applet.in:172 +#, c-format +msgid "Found service '%s' of type '%s' in domain '%s' on %s.%i." +msgstr "Dienst '%s' vom Typ '%s' in Domain '%s' auf %s.%i gefunden." + +#: ../src/service-discovery-applet.in:209 +#, c-format +msgid "Service '%s' of type '%s' in domain '%s' on %s.%i disappeared." +msgstr "Dienst '%s' vom Typ '%s' in Domain '%s' auf %s.%i verschwunden." + +#: ../src/service-discovery-applet.in:231 +#, c-format +msgid "" +"Name : %s\n" +"Type : %s (%s)" +msgstr "" +"Name : %s\n" +"Typ : %s (%s)" + +#: ../src/service-discovery-applet.in:234 +msgid "New service found." +msgstr "Neuer Dienst gefunden." + +#: ../src/service-discovery-applet.in:236 +msgid "Service disappeared." +msgstr "Dienst verschwunden." + +#: ../src/service-discovery-applet.in:243 +#: ../src/service-discovery-applet.in:330 +msgid "Service Discovery Applet" +msgstr "Zeroconf Dienstsuche" + +#: ../src/service-discovery-applet.in:248 +msgid "can't use notification daemon" +msgstr "Kann Benachrichtigungsdaemon nicht benutzen" + +#: ../src/service-discovery-applet.in:256 +#, c-format +msgid "Browsing for services of type '%s' in domain '%s' on %s.%i ..." +msgstr "Durchsuche Dienste vom Typ '%s' in Domain '%s' auf %s.%i ..." + +#: ../src/service-discovery-applet.in:331 +msgid "Copyright (C) 2005 Sebastien Estienne" +msgstr "Copyright (C) 2005 Sebastien Estienne" + +#: ../src/service-discovery-applet.in:332 +msgid "An applet to quickly access your zeroconf services." +msgstr "Zeigt Zeroconf Dienste an und erlaubt schnellen Zugriff darauf" + +#: ../src/service-discovery-applet.in:334 +msgid "translator-credits" +msgstr "Sebastian Dröge " + +#: ../src/service-discovery-applet.in:348 +#, c-format +msgid "domain not null %s" +msgstr "Domain ist nicht null %s" + +#: ../src/service-discovery-applet.in:349 +msgid "Already running" +msgstr "Schon am Laufen" + +#: ../src/service-discovery-applet.in:354 +msgid "Error Detected!" +msgstr "Fehler entdeckt!" + +#: ../src/service-discovery-applet.in:354 +msgid "Check that Avahi daemon is running!" +msgstr "Bitte überprüfen Sie ob der Avahi Dienst läuft!" + +#: ../src/service-discovery-applet.in:357 +msgid "Starting discovery" +msgstr "Suche gestartet" + +#: ../src/service-discovery-applet.in:373 +msgid "Already stopped" +msgstr "Schon gestoppt" + +#: ../src/service-discovery-applet.in:379 +msgid "Discovery stopped" +msgstr "Suche gestoppt" + +#: ../src/service-discovery-applet.in:387 +#, c-format +msgid "browse %s" +msgstr "durchsuche %s" + +#: ../src/service-discovery-applet.in:391 +#, c-format +msgid "remove %s" +msgstr "entferne %s" + +#: ../src/service-discovery-applet.in:422 +msgid "Service discovery applet" +msgstr "Zeroconf Dienstsuche" + +#: ../src/service-discovery-config.glade.h:1 +msgid "Advanced options :" +msgstr "Erweiterte Einstellungen :" + +#: ../src/service-discovery-config.glade.h:2 +msgid "Service type that will be browsed." +msgstr "Diensttypen die durchsucht werden sollen." + +#: ../src/service-discovery-config.glade.h:3 +msgid "Advanced" +msgstr "Erweitert" + +#: ../src/service-discovery-config.glade.h:4 +msgid "Browse for my own services." +msgstr "Durchsuche Dienste auf diesem Rechner" + +#: ../src/service-discovery-config.glade.h:6 +msgid "Service Discovery Applet Preferences" +msgstr "Dienstsuche Einstellungen" + +#: ../src/service-discovery-config.glade.h:7 +msgid "Services" +msgstr "Dienste" + +#: ../src/service-discovery-config.glade.h:8 +msgid "services informations" +msgstr "Dienstinformationen" + +#: ../src/service-discovery-config.in:91 +msgid "Enabled" +msgstr "Aktiviert" + +#: ../src/service-discovery-config.in:105 +msgid "Service type" +msgstr "Typ" + +#: ../src/service-discovery-config.in:139 +msgid "_service._protocol" +msgstr "_dienst._protokoll" + +#: ../src/service-discovery-config.in:177 +msgid "A new main_window has been created" +msgstr "Ein neues Hauptfenster wurde erstellt" diff --git a/po/service-discovery-applet.pot b/po/service-discovery-applet.pot new file mode 100644 index 0000000..f0b8331 --- /dev/null +++ b/po/service-discovery-applet.pot @@ -0,0 +1,236 @@ +# 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 , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2005-10-06 15:33+0200\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" + +#: ../actions/services/__init__.py.in:34 ../src/service-discovery-applet.in:49 +#: ../src/service-discovery-config.in:39 +#, c-format, python-format +msgid "" +"A python module is missing.\n" +"%s" +msgstr "" + +#: ../actions/services/__init__.py.in:107 +msgid "SSH Connection" +msgstr "" + +#: ../actions/services/__init__.py.in:116 +#, python-format +msgid "" +"Connecting to %s.\n" +"Please enter your login:" +msgstr "" + +#: ../schemas/service-discovery-applet.schemas.in.h:1 +msgid "Browse for your own services." +msgstr "" + +#: ../schemas/service-discovery-applet.schemas.in.h:2 +#: ../src/service-discovery-config.glade.h:5 +msgid "Display notifications." +msgstr "" + +#: ../schemas/service-discovery-applet.schemas.in.h:3 +msgid "First time you start the app?" +msgstr "" + +#: ../schemas/service-discovery-applet.schemas.in.h:4 +msgid "" +"Use the notification deamon to notify the user when a service is discovered." +msgstr "" + +#: ../servers/GNOME_ServiceDiscoveryApplet.server.in.h:1 +msgid "" +"This applet allow you to quickly access the zeroconf services available on " +"your network." +msgstr "" + +#: ../servers/GNOME_ServiceDiscoveryApplet.server.in.h:2 +msgid "Zeroconf service discovery applet" +msgstr "" + +#: ../src/service-discovery-applet.in:123 +msgid "About" +msgstr "" + +#: ../src/service-discovery-applet.in:123 +msgid "_Config" +msgstr "" + +#: ../src/service-discovery-applet.in:123 +msgid "_Start" +msgstr "" + +#: ../src/service-discovery-applet.in:123 +msgid "_Stop" +msgstr "" + +#: ../src/service-discovery-applet.in:148 +msgid "start notifying" +msgstr "" + +#: ../src/service-discovery-applet.in:158 +#, c-format +msgid "Service data for service '%s' of type '%s' in domain '%s' on %s.%i:" +msgstr "" + +#: ../src/service-discovery-applet.in:159 +#, c-format +msgid "\tHost %s (%s), port %i, TXT data: %s" +msgstr "" + +#: ../src/service-discovery-applet.in:166 +msgid "Error:" +msgstr "" + +#: ../src/service-discovery-applet.in:172 +#, c-format +msgid "Found service '%s' of type '%s' in domain '%s' on %s.%i." +msgstr "" + +#: ../src/service-discovery-applet.in:209 +#, c-format +msgid "Service '%s' of type '%s' in domain '%s' on %s.%i disappeared." +msgstr "" + +#: ../src/service-discovery-applet.in:231 +#, c-format +msgid "" +"Name : %s\n" +"Type : %s (%s)" +msgstr "" + +#: ../src/service-discovery-applet.in:234 +msgid "New service found." +msgstr "" + +#: ../src/service-discovery-applet.in:236 +msgid "Service disappeared." +msgstr "" + +#: ../src/service-discovery-applet.in:243 +#: ../src/service-discovery-applet.in:330 +msgid "Service Discovery Applet" +msgstr "" + +#: ../src/service-discovery-applet.in:248 +msgid "can't use notification daemon" +msgstr "" + +#: ../src/service-discovery-applet.in:256 +#, c-format +msgid "Browsing for services of type '%s' in domain '%s' on %s.%i ..." +msgstr "" + +#: ../src/service-discovery-applet.in:331 +msgid "Copyright (C) 2005 Sebastien Estienne" +msgstr "" + +#: ../src/service-discovery-applet.in:332 +msgid "An applet to quickly access your zeroconf services." +msgstr "" + +#: ../src/service-discovery-applet.in:334 +msgid "translator-credits" +msgstr "" + +#: ../src/service-discovery-applet.in:348 +#, c-format +msgid "domain not null %s" +msgstr "" + +#: ../src/service-discovery-applet.in:349 +msgid "Already running" +msgstr "" + +#: ../src/service-discovery-applet.in:354 +msgid "Error Detected!" +msgstr "" + +#: ../src/service-discovery-applet.in:354 +msgid "Check that Avahi daemon is running!" +msgstr "" + +#: ../src/service-discovery-applet.in:357 +msgid "Starting discovery" +msgstr "" + +#: ../src/service-discovery-applet.in:373 +msgid "Already stopped" +msgstr "" + +#: ../src/service-discovery-applet.in:379 +msgid "Discovery stopped" +msgstr "" + +#: ../src/service-discovery-applet.in:387 +#, c-format +msgid "browse %s" +msgstr "" + +#: ../src/service-discovery-applet.in:391 +#, c-format +msgid "remove %s" +msgstr "" + +#: ../src/service-discovery-applet.in:422 +msgid "Service discovery applet" +msgstr "" + +#: ../src/service-discovery-config.glade.h:1 +msgid "Advanced options :" +msgstr "" + +#: ../src/service-discovery-config.glade.h:2 +msgid "Service type that will be browsed." +msgstr "" + +#: ../src/service-discovery-config.glade.h:3 +msgid "Advanced" +msgstr "" + +#: ../src/service-discovery-config.glade.h:4 +msgid "Browse for my own services." +msgstr "" + +#: ../src/service-discovery-config.glade.h:6 +msgid "Service Discovery Applet Preferences" +msgstr "" + +#: ../src/service-discovery-config.glade.h:7 +msgid "Services" +msgstr "" + +#: ../src/service-discovery-config.glade.h:8 +msgid "services informations" +msgstr "" + +#: ../src/service-discovery-config.in:91 +msgid "Enabled" +msgstr "" + +#: ../src/service-discovery-config.in:105 +msgid "Service type" +msgstr "" + +#: ../src/service-discovery-config.in:139 +msgid "_service._protocol" +msgstr "" + +#: ../src/service-discovery-config.in:177 +msgid "A new main_window has been created" +msgstr "" diff --git a/schemas/Makefile.am b/schemas/Makefile.am index aae3947..dffc000 100644 --- a/schemas/Makefile.am +++ b/schemas/Makefile.am @@ -1,12 +1,12 @@ -SCHEMAS_FILE = service-discovery-applet.schemas - -EXTRA_DIST = $(SCHEMAS_FILE) +EXTRA_DIST = $(schemas_in_files) schemasdir = $(GCONF_SCHEMA_FILE_DIR) -schemas_DATA = $(SCHEMAS_FILE) +schemas_in_files = service-discovery-applet.schemas.in +schemas_DATA = $(schemas_in_files:.schemas.in=.schemas) +@INTLTOOL_SCHEMAS_RULE@ install-schemas: - GCONF_CONFIG_SOURCE=$(GCONF_SCHEMA_CONFIG_SOURCE) gconftool-2 --makefile-install-rule $(top_srcdir)/schemas/$(SCHEMAS_FILE) 2>&1 > /dev/null + GCONF_CONFIG_SOURCE=$(GCONF_SCHEMA_CONFIG_SOURCE) gconftool-2 --makefile-install-rule $(top_srcdir)/schemas/$(schemas_DATA) 2>&1 > /dev/null gconftool-2 --shutdown if GCONF_SCHEMAS_INSTALL diff --git a/schemas/service-discovery-applet.schemas b/schemas/service-discovery-applet.schemas deleted file mode 100644 index 2ceaefa..0000000 --- a/schemas/service-discovery-applet.schemas +++ /dev/null @@ -1,41 +0,0 @@ - - - - /schemas/apps/service-discovery-applet/options/show_notifications - /apps/service-discovery-applet/options/show_notifications - service-discovery-applet - bool - TRUE - - Display notifications. - - Use the notification deamon to notify the user when a service is discovered. - - - - - /schemas/apps/service-discovery-applet/options/show_local_services - /apps/service-discovery-applet/options/show_local_services - service-discovery-applet - bool - FALSE - - Browse for your own services. - - - - - - /schemas/apps/service-discovery-applet/options/first_run - /apps/service-discovery-applet/options/first_run - service-discovery-applet - bool - TRUE - - First time you start the app? - - - - - - diff --git a/schemas/service-discovery-applet.schemas.in b/schemas/service-discovery-applet.schemas.in new file mode 100644 index 0000000..2ceaefa --- /dev/null +++ b/schemas/service-discovery-applet.schemas.in @@ -0,0 +1,41 @@ + + + + /schemas/apps/service-discovery-applet/options/show_notifications + /apps/service-discovery-applet/options/show_notifications + service-discovery-applet + bool + TRUE + + Display notifications. + + Use the notification deamon to notify the user when a service is discovered. + + + + + /schemas/apps/service-discovery-applet/options/show_local_services + /apps/service-discovery-applet/options/show_local_services + service-discovery-applet + bool + FALSE + + Browse for your own services. + + + + + + /schemas/apps/service-discovery-applet/options/first_run + /apps/service-discovery-applet/options/first_run + service-discovery-applet + bool + TRUE + + First time you start the app? + + + + + + diff --git a/servers/GNOME_ServiceDiscoveryApplet.server.in b/servers/GNOME_ServiceDiscoveryApplet.server.in index ec947b4..a52a094 100644 --- a/servers/GNOME_ServiceDiscoveryApplet.server.in +++ b/servers/GNOME_ServiceDiscoveryApplet.server.in @@ -8,8 +8,8 @@ - - + + - - + + diff --git a/servers/Makefile.am b/servers/Makefile.am index 55986c0..6e10f91 100644 --- a/servers/Makefile.am +++ b/servers/Makefile.am @@ -1,11 +1,13 @@ serversdir = $(libdir)/bonobo/servers/ -servers_DATA = GNOME_ServiceDiscoveryApplet.server +servers_in_files = GNOME_ServiceDiscoveryApplet.server.in +servers_DATA = $(servers_in_files:.server.in=.server) +@INTLTOOL_SERVER_RULE@ -GNOME_ServiceDiscoveryApplet.server: GNOME_ServiceDiscoveryApplet.server.in - sed \ +all: GNOME_ServiceDiscoveryApplet.server + sed -i \ -e 's,@bindir\@,$(bindir),g' \ -e 's,@iconsdir\@,$(ICONSDIR),g' \ - $< > $@ + GNOME_ServiceDiscoveryApplet.server EXTRA_DIST = GNOME_ServiceDiscoveryApplet.server.in diff --git a/src/Makefile.am b/src/Makefile.am index 65ea593..88a8a6b 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -19,6 +19,8 @@ service-discovery-applet: service-discovery-applet.in -e 's,@version\@,$(VERSION),g' \ -e 's,@iconsdir\@,$(ICONSDIR),g' \ -e 's,@actionsdir\@,$(ACTIONSDIR),g' \ + -e 's,@GETTEXT_PACKAGE\@,$(GETTEXT_PACKAGE),g' \ + -e 's,@LOCALEDIR\@,$(LOCALEDIR),g' \ $< > $@ chmod +x $@ @@ -29,6 +31,8 @@ service-discovery-config: service-discovery-config.in -e 's,@iconsdir\@,$(ICONSDIR),g' \ -e 's,@interfacesdir\@,$(INTERFACESDIR),g' \ -e 's,@actionsdir\@,$(ACTIONSDIR),g' \ + -e 's,@GETTEXT_PACKAGE\@,$(GETTEXT_PACKAGE),g' \ + -e 's,@LOCALEDIR\@,$(LOCALEDIR),g' \ $< > $@ chmod +x $@ diff --git a/src/service-discovery-applet.in b/src/service-discovery-applet.in index 7e3e937..d6dfea6 100755 --- a/src/service-discovery-applet.in +++ b/src/service-discovery-applet.in @@ -33,6 +33,10 @@ def error_msg(msg): d.destroy() try: + import gettext + gettext.bindtextdomain("@GETTEXT_PACKAGE@", "@LOCALEDIR@") + gettext.textdomain("@GETTEXT_PACKAGE@") + gettext.install("@GETTEXT_PACKAGE@", unicode=1) import gobject import avahi import dbus @@ -42,7 +46,7 @@ try: import gconf import avahi.ServiceTypeDatabase except ImportError, e: - error_msg("A python module is missing.\n%s" % (e)) + error_msg(_("A python module is missing.\n%s") % (e)) sys.exit() try: @@ -110,14 +114,15 @@ class ServiceDiscoveryApplet(gnomeapplet.Applet): # funky right-click menu menuXml = """ - - - - + + + + """ - - applet.setup_menu(menuXml, [ + menuXml = menuXml % (_("About"), _("_Config"), _("_Start"), _("_Stop")) + + applet.setup_menu(menuXml, [ ("SDA About", self.on_about), ("SDA Config", self.on_config), ("SDA Start", self.start_service_discovery), @@ -224,19 +229,19 @@ class ServiceDiscoveryApplet(gnomeapplet.Applet): if not os.path.exists(iconfile): iconfile = "@iconsdir@/48x48/service-discovery-applet.png" - message = "Name : %s\nType : %s (%s)" % (name, pretty_name, type) + message = _("Name : %s\nType : %s (%s)") % (name, pretty_name, type) if new == True: - title = "New service found." + title = _("New service found.") else: - title = "Service disappeared." + title = _("Service disappeared.") self.display_notification(title, message, iconfile) def display_notification(self, title, message, iconfile = "@iconsdir@/48x48/service-discovery-applet.png"): try: if self.show_notifications == True: - self.notif.Notify("Service Discovery Applet", + self.notif.Notify(_("Service Discovery Applet"), iconfile, dbus.UInt32(0),"",dbus.Byte(0), title,message, [iconfile],[""],[""],True,dbus.UInt32(3)) @@ -321,12 +326,15 @@ class ServiceDiscoveryApplet(gnomeapplet.Applet): icon = gtk.Image() icon.set_from_file("@iconsdir@/48x48/service-discovery-applet.png") - fullname = "Service Discovery Applet" - copyright = "Copyright (C) 2005 Sebastien Estienne" - description = "An applet to quickly access your zeroconf services." + fullname = _("Service Discovery Applet") + copyright = _("Copyright (C) 2005 Sebastien Estienne") + description = _("An applet to quickly access your zeroconf services.") authors = ["Sebastien Estienne "] + translators = _("translator-credits") + if translators == "translator-credits": + translators = None - about = gnome.ui.About(fullname, "@version@", copyright, description, authors, None, None, icon.get_pixbuf()) + about = gnome.ui.About(fullname, "@version@", copyright, description, authors, None, translators, icon.get_pixbuf()) about.set_icon(icon.get_pixbuf()) about.show() @@ -337,15 +345,15 @@ class ServiceDiscoveryApplet(gnomeapplet.Applet): def start_service_discovery(self, component, verb, applet): if len(self.domain) != 0: print "domain not null %s" % (self.domain) - self.display_notification("Already running","") + self.display_notification(_("Already running"),"") return try: self.domain = self.server.GetDomainName() except: - self.display_notification("Error Detected!","Check that Avahi daemon is running!") + self.display_notification(_("Error Detected!"),_("Check that Avahi daemon is running!")) return - self.display_notification("Starting discovery","") + self.display_notification(_("Starting discovery"),"") self.interface = avahi.IF_UNSPEC self.protocol = avahi.PROTO_INET @@ -361,13 +369,13 @@ class ServiceDiscoveryApplet(gnomeapplet.Applet): def stop_service_discovery(self, component, verb, applet): if len(self.domain) == 0: - self.display_notification("Already stopped","") + self.display_notification(_("Already stopped"),"") return for service in self.service_browsers.copy(): self.del_service_type(service[0],service[1],service[2],service[3]) self.domain = "" - self.display_notification("Discovery stopped","") + self.display_notification(_("Discovery stopped"),"") # Callback called when a service is added/removed/enabled/disabled in gconf def gc_services_cb (self, client, cnxn_id, gc_entry, data): @@ -410,7 +418,7 @@ def main(): gobject.type_register(ServiceDiscoveryApplet) if len(sys.argv) == 2 and sys.argv[1] == "-window": applet_window = gtk.Window(gtk.WINDOW_TOPLEVEL) - applet_window.set_title("Service discovery applet") + applet_window.set_title(_("Service discovery applet")) applet_window.connect("destroy", gtk.main_quit) gnome.init("Service discovery applet", "@version@") applet = gnomeapplet.Applet() diff --git a/src/service-discovery-config.glade b/src/service-discovery-config.glade index 72f5c5b..f59ff53 100644 --- a/src/service-discovery-config.glade +++ b/src/service-discovery-config.glade @@ -97,7 +97,7 @@ True - <b>Service type that will be browsed.</b> + <b>Service type that will be browsed.</b> False True GTK_JUSTIFY_LEFT @@ -147,7 +147,7 @@ - services informations + services informations False False GTK_JUSTIFY_LEFT @@ -247,7 +247,7 @@ True True - Display notifications. + Display notifications. True GTK_RELIEF_NORMAL True @@ -268,7 +268,7 @@ True True - Browse for my own services. + Browse for my own services. True GTK_RELIEF_NORMAL True diff --git a/src/service-discovery-config.in b/src/service-discovery-config.in index b0aa57f..a729c48 100755 --- a/src/service-discovery-config.in +++ b/src/service-discovery-config.in @@ -24,12 +24,19 @@ def error_msg(msg): d.destroy() try: + import gettext + gettext.bindtextdomain("@GETTEXT_PACKAGE@", "@LOCALEDIR@") + gettext.textdomain("@GETTEXT_PACKAGE@") + gettext.install("@GETTEXT_PACKAGE@", unicode=1) import gtk + import gtk.glade + gtk.glade.bindtextdomain("@GETTEXT_PACKAGE@", "@LOCALEDIR@") + gtk.glade.textdomain("@GETTEXT_PACKAGE@") import gobject import gconf import avahi except ImportError, e: - error_msg("A python module is missing.\n%s" % (e)) + error_msg(_("A python module is missing.\n%s") % (e)) sys.exit() from avahi.SimpleGladeApp import SimpleGladeApp @@ -81,7 +88,7 @@ class Config_window(SimpleGladeApp): renderer = gtk.CellRendererToggle() renderer.connect('toggled', self.enabled_toggled, model) - column = gtk.TreeViewColumn('Enabled', renderer, active=COLUMN_ENABLED) + column = gtk.TreeViewColumn(_("Enabled"), renderer, active=COLUMN_ENABLED) # set this column to a fixed sizing(of 50 pixels) #column.set_sizing(gtk.TREE_VIEW_COLUMN_FIXED) @@ -95,7 +102,7 @@ class Config_window(SimpleGladeApp): renderer.connect("edited", self.on_cell_edited, model) renderer.set_data("column", COLUMN_SERVICE) - column = gtk.TreeViewColumn('Service type', renderer, + column = gtk.TreeViewColumn(_("Service type"), renderer, text=COLUMN_SERVICE, editable=COLUMN_EDITABLE) treeview.append_column(column) @@ -129,7 +136,7 @@ class Config_window(SimpleGladeApp): iter = model.append() model.set (iter, COLUMN_ENABLED, False, - COLUMN_SERVICE, "_service._protocol", + COLUMN_SERVICE, _("_service._protocol"), COLUMN_NAME, None, COLUMN_ACTION, False, COLUMN_EDITABLE, True) -- cgit