more translation fixes (#108)
This commit is contained in:
parent
e42f7f1393
commit
9934755566
|
@ -189,7 +189,7 @@ def _process_hidpp10_notification(device, status, n):
|
||||||
if n.address == 0x01:
|
if n.address == 0x01:
|
||||||
if _log.isEnabledFor(_DEBUG):
|
if _log.isEnabledFor(_DEBUG):
|
||||||
_log.debug("%s: device powered on", device)
|
_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)
|
status.changed(active=True, alert=_ALERT.NOTIFICATION, reason=reason)
|
||||||
else:
|
else:
|
||||||
_log.warn("%s: unknown %s", device, n)
|
_log.warn("%s: unknown %s", device, n)
|
||||||
|
|
|
@ -139,7 +139,7 @@ class DeviceStatus(dict):
|
||||||
# timestamp of when this status object was last updated
|
# timestamp of when this status object was last updated
|
||||||
self.updated = 0
|
self.updated = 0
|
||||||
|
|
||||||
def __str__(self):
|
def to_string(self):
|
||||||
def _items():
|
def _items():
|
||||||
comma = False
|
comma = False
|
||||||
|
|
||||||
|
@ -163,8 +163,6 @@ class DeviceStatus(dict):
|
||||||
|
|
||||||
return ''.join(i for i in _items())
|
return ''.join(i for i in _items())
|
||||||
|
|
||||||
__unicode__ = __str__
|
|
||||||
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
return '{' + ', '.join('\'%s\': %r' % (k, v) for k, v in self.items()) + '}'
|
return '{' + ', '.join('\'%s\': %r' % (k, v) for k, v in self.items()) + '}'
|
||||||
|
|
||||||
|
|
|
@ -70,6 +70,7 @@ def _create_choice_control(setting):
|
||||||
_write_async(s, cbbox.get_active_id(), cbbox.get_parent())
|
_write_async(s, cbbox.get_active_id(), cbbox.get_parent())
|
||||||
|
|
||||||
c = Gtk.ComboBoxText()
|
c = Gtk.ComboBoxText()
|
||||||
|
# TODO i18n text entries
|
||||||
for entry in setting.choices:
|
for entry in setting.choices:
|
||||||
c.append(str(entry), str(entry))
|
c.append(str(entry), str(entry))
|
||||||
c.connect('changed', _combo_notify, setting)
|
c.connect('changed', _combo_notify, setting)
|
||||||
|
|
|
@ -117,7 +117,7 @@ try:
|
||||||
elif dev.status is None:
|
elif dev.status is None:
|
||||||
message = _("unpaired")
|
message = _("unpaired")
|
||||||
elif bool(dev.status):
|
elif bool(dev.status):
|
||||||
message = dev.status.__str__() or _("connected")
|
message = dev.status.to_string() or _("connected")
|
||||||
else:
|
else:
|
||||||
message = _("offline")
|
message = _("offline")
|
||||||
|
|
||||||
|
|
|
@ -281,7 +281,7 @@ def _generate_tooltip_lines():
|
||||||
if number is None: # receiver
|
if number is None: # receiver
|
||||||
continue
|
continue
|
||||||
|
|
||||||
p = str(status)
|
p = status.to_string()
|
||||||
if p: # does it have any properties to print?
|
if p: # does it have any properties to print?
|
||||||
yield '<b>%s</b>' % name
|
yield '<b>%s</b>' % name
|
||||||
if status:
|
if status:
|
||||||
|
|
|
@ -530,7 +530,7 @@ def _update_details(button):
|
||||||
|
|
||||||
if read_all:
|
if read_all:
|
||||||
for fw in list(device.firmware):
|
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:
|
elif device.kind is None or device.online:
|
||||||
yield (' %s' % _("Firmware"), '...')
|
yield (' %s' % _("Firmware"), '...')
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue