summaryrefslogtreecommitdiffstats
path: root/avahi-python
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2010-06-28 22:48:53 +0200
committerLennart Poettering <lennart@poettering.net>2010-06-28 22:48:53 +0200
commitd65a31ce300db68c303b9ff72c52b78dbf1ba598 (patch)
treeb11aa03f8ca6730884e86af1e7705c9e9871a3c8 /avahi-python
parent0e8a4f32e3182d5a2337ca679f7a144cbe341f17 (diff)
i18n: make avahi-discover translatable.
Original patch from "fujiwara" http://avahi.org/ticket/122
Diffstat (limited to 'avahi-python')
-rw-r--r--avahi-python/avahi-discover/Makefile.am6
-rwxr-xr-xavahi-python/avahi-discover/avahi-discover.py (renamed from avahi-python/avahi-discover/avahi-discover.in)17
2 files changed, 15 insertions, 8 deletions
diff --git a/avahi-python/avahi-discover/Makefile.am b/avahi-python/avahi-discover/Makefile.am
index 454fd57..d16bd11 100644
--- a/avahi-python/avahi-discover/Makefile.am
+++ b/avahi-python/avahi-discover/Makefile.am
@@ -19,7 +19,7 @@ AM_CFLAGS=-I$(top_srcdir)
EXTRA_DIST = \
__init__.py \
- avahi-discover.in \
+ avahi-discover.py \
avahi-discover.desktop.in.in
if HAVE_PYTHON
@@ -53,10 +53,10 @@ endif
avahi-discover.desktop.in: avahi-discover.desktop.in.in
$(AM_V_GEN)sed -e 's,@bindir\@,$(bindir),g' $< > $@
-avahi-discover: avahi-discover.in
+avahi-discover: avahi-discover.py
$(AM_V_GEN)sed -e 's,@PYTHON\@,$(PYTHON),g' \
-e 's,@GETTEXT_PACKAGE\@,"$(GETTEXT_PACKAGE)",g' \
- -e 's,@LOCALEDIR\@,"$(datadir)/locale",g' \
+ -e 's,@LOCALEDIR\@,"$(avahilocaledir)",g' \
-e 's,@interfacesdir\@,$(interfacesdir),g' $< > $@ && \
chmod +x $@
diff --git a/avahi-python/avahi-discover/avahi-discover.in b/avahi-python/avahi-discover/avahi-discover.py
index ac6b657..cea1ff9 100755
--- a/avahi-python/avahi-discover/avahi-discover.in
+++ b/avahi-python/avahi-discover/avahi-discover.py
@@ -21,6 +21,8 @@ import os, sys
try:
import avahi, gettext, gtk, gobject, dbus, avahi.ServiceTypeDatabase
+ gettext.bindtextdomain(@GETTEXT_PACKAGE@, @LOCALEDIR@)
+ gettext.textdomain(@GETTEXT_PACKAGE@)
_ = gettext.gettext
except ImportError, e:
print "Sorry, to use this tool you need to install Avahi, pygtk and python-dbus.\n Error: %s" % e
@@ -71,7 +73,7 @@ class Main_window:
if iter is not None:
(name,interface,protocol,stype,domain) = self.treemodel.get(iter,1,2,3,4,5)
if stype == None:
- self.info_label.set_markup("<i>No service currently selected.</i>")
+ self.info_label.set_markup(_("<i>No service currently selected.</i>"))
return
#Asynchronous resolving
self.server.ResolveService( int(interface), int(protocol), name, stype, domain, avahi.PROTO_UNSPEC, dbus.UInt32(0), reply_handler=self.service_resolved, error_handler=self.print_error)
@@ -219,11 +221,16 @@ class Main_window:
txts = ""
txtd = self.pair_to_dict(txt)
for k,v in txtd.items():
- txts+="<b>TXT <i>%s</i></b> = %s\n" % (k,v)
+ txts+="<b>" + _("TXT") + " <i>%s</i></b> = %s\n" % (k,v)
else:
- txts = "<b>TXT Data:</b> <i>empty</i>"
-
- infos = "<b>Service Type:</b> %s\n<b>Service Name:</b> %s\n<b>Domain Name:</b> %s\n<b>Interface:</b> %s %s\n<b>Address:</b> %s/%s:%i\n%s" % (stype, name, domain, self.siocgifname(interface), self.protoname(protocol), host, address, port, txts.strip())
+ txts = "<b>" + _("TXT Data:") + "</b> <i>" + _("empty") + "</i>"
+
+ infos = "<b>" + _("Service Type:") + "</b> %s\n"
+ infos += "<b>" + _("Service Name:") + "</b> %s\n"
+ infos += "<b>" + _("Domain Name:") + "</b> %s\n"
+ infos += "<b>" + _("Interface:") + "</b> %s %s\n"
+ infos += "<b>" + _("Address:") + "</b> %s/%s:%i\n%s"
+ infos = infos % (stype, name, domain, self.siocgifname(interface), self.protoname(protocol), host, address, port, txts.strip())
self.info_label.set_markup(infos)
def insert_row(self, model,parent,