more translation fixes (#108)

This commit is contained in:
Daniel Pavel 2013-08-12 00:32:19 +02:00
parent e42f7f1393
commit 9934755566
6 changed files with 6 additions and 7 deletions

View File

@ -189,7 +189,7 @@ def _process_hidpp10_notification(device, status, n):
if n.address == 0x01:
if _log.isEnabledFor(_DEBUG):
_log.debug("%s: device powered on", device)
reason = str(status) or _("powered on")
reason = status.to_string() or _("powered on")
status.changed(active=True, alert=_ALERT.NOTIFICATION, reason=reason)
else:
_log.warn("%s: unknown %s", device, n)

View File

@ -139,7 +139,7 @@ class DeviceStatus(dict):
# timestamp of when this status object was last updated
self.updated = 0
def __str__(self):
def to_string(self):
def _items():
comma = False
@ -163,8 +163,6 @@ class DeviceStatus(dict):
return ''.join(i for i in _items())
__unicode__ = __str__
def __repr__(self):
return '{' + ', '.join('\'%s\': %r' % (k, v) for k, v in self.items()) + '}'

View File

@ -70,6 +70,7 @@ def _create_choice_control(setting):
_write_async(s, cbbox.get_active_id(), cbbox.get_parent())
c = Gtk.ComboBoxText()
# TODO i18n text entries
for entry in setting.choices:
c.append(str(entry), str(entry))
c.connect('changed', _combo_notify, setting)

View File

@ -117,7 +117,7 @@ try:
elif dev.status is None:
message = _("unpaired")
elif bool(dev.status):
message = dev.status.__str__() or _("connected")
message = dev.status.to_string() or _("connected")
else:
message = _("offline")

View File

@ -281,7 +281,7 @@ def _generate_tooltip_lines():
if number is None: # receiver
continue
p = str(status)
p = status.to_string()
if p: # does it have any properties to print?
yield '<b>%s</b>' % name
if status:

View File

@ -530,7 +530,7 @@ def _update_details(button):
if read_all:
for fw in list(device.firmware):
yield (' ' + str(fw.kind), (fw.name + ' ' + fw.version).strip())
yield (' ' + _(str(fw.kind)), (fw.name + ' ' + fw.version).strip())
elif device.kind is None or device.online:
yield (' %s' % _("Firmware"), '...')