i18n: mark more strings as translatable
This commit is contained in:
parent
ee4275f45c
commit
a1874c572b
|
@ -30,6 +30,7 @@
|
|||
from __future__ import absolute_import, division, print_function, unicode_literals
|
||||
|
||||
from .descriptors import DEVICES as _DEVICES
|
||||
from .i18n import _
|
||||
|
||||
# max_devices is only used for receivers that do not support reading from _R.receiver_info offset 0x03, default to 1
|
||||
# may_unpair is only used for receivers that do not support reading from _R.receiver_info offset 0x03, default to False
|
||||
|
@ -46,7 +47,7 @@ _unifying_receiver = lambda product_id: {
|
|||
'product_id': product_id,
|
||||
'usb_interface': 2,
|
||||
'hid_driver': _DRIVER, # noqa: F821
|
||||
'name': 'Unifying Receiver'
|
||||
'name': _('Unifying Receiver')
|
||||
}
|
||||
|
||||
_nano_receiver = lambda product_id: {
|
||||
|
@ -54,7 +55,7 @@ _nano_receiver = lambda product_id: {
|
|||
'product_id': product_id,
|
||||
'usb_interface': 1,
|
||||
'hid_driver': _DRIVER, # noqa: F821
|
||||
'name': 'Nano Receiver',
|
||||
'name': _('Nano Receiver'),
|
||||
'may_unpair': False,
|
||||
're_pairs': True
|
||||
}
|
||||
|
@ -64,7 +65,7 @@ _nano_receiver_no_unpair = lambda product_id: {
|
|||
'product_id': product_id,
|
||||
'usb_interface': 1,
|
||||
'hid_driver': _DRIVER, # noqa: F821
|
||||
'name': 'Nano Receiver',
|
||||
'name': _('Nano Receiver'),
|
||||
'may_unpair': False,
|
||||
'unpair': False,
|
||||
're_pairs': True
|
||||
|
@ -75,7 +76,7 @@ _nano_receiver_max2 = lambda product_id: {
|
|||
'product_id': product_id,
|
||||
'usb_interface': 1,
|
||||
'hid_driver': _DRIVER, # noqa: F821
|
||||
'name': 'Nano Receiver',
|
||||
'name': _('Nano Receiver'),
|
||||
'max_devices': 2,
|
||||
'may_unpair': False,
|
||||
're_pairs': True
|
||||
|
@ -86,7 +87,7 @@ _nano_receiver_maxn = lambda product_id, max: {
|
|||
'product_id': product_id,
|
||||
'usb_interface': 1,
|
||||
'hid_driver': _DRIVER, # noqa: F821
|
||||
'name': 'Nano Receiver',
|
||||
'name': _('Nano Receiver'),
|
||||
'max_devices': max,
|
||||
'may_unpair': False,
|
||||
're_pairs': True
|
||||
|
@ -97,7 +98,7 @@ _lenovo_receiver = lambda product_id: {
|
|||
'product_id': product_id,
|
||||
'usb_interface': 1,
|
||||
'hid_driver': _DRIVER, # noqa: F821
|
||||
'name': 'Nano Receiver'
|
||||
'name': _('Nano Receiver')
|
||||
}
|
||||
|
||||
_lightspeed_receiver = lambda product_id: {
|
||||
|
@ -105,7 +106,7 @@ _lightspeed_receiver = lambda product_id: {
|
|||
'product_id': product_id,
|
||||
'usb_interface': 2,
|
||||
'hid_driver': _DRIVER, # noqa: F821
|
||||
'name': 'Lightspeed Receiver'
|
||||
'name': _('Lightspeed Receiver')
|
||||
}
|
||||
|
||||
_ex100_receiver = lambda product_id: {
|
||||
|
@ -113,7 +114,7 @@ _ex100_receiver = lambda product_id: {
|
|||
'product_id': product_id,
|
||||
'usb_interface': 1,
|
||||
'hid_driver': _DRIVER, # noqa: F821
|
||||
'name': 'EX100 Receiver 27 Mhz',
|
||||
'name': _('EX100 Receiver 27 Mhz'),
|
||||
'max_devices': 4,
|
||||
'may_unpair': False,
|
||||
're_pairs': True,
|
||||
|
|
|
@ -38,17 +38,24 @@ _DUMMY = (
|
|||
_('empty'),
|
||||
_('critical'),
|
||||
_('low'),
|
||||
_('average'),
|
||||
_('good'),
|
||||
_('full'),
|
||||
|
||||
# battery charging statuses
|
||||
_('discharging'),
|
||||
_('recharging'),
|
||||
_('charging'),
|
||||
_('not charging'),
|
||||
_('almost full'),
|
||||
_('charged'),
|
||||
_('slow recharge'),
|
||||
_('invalid battery'),
|
||||
_('thermal error'),
|
||||
_('error'),
|
||||
_('standard'),
|
||||
_('fast'),
|
||||
_('slow'),
|
||||
|
||||
# pairing errors
|
||||
_('device timeout'),
|
||||
|
|
|
@ -33,6 +33,7 @@ from .common import NamedInts as _NamedInts
|
|||
from .common import bytes2int as _bytes2int
|
||||
from .common import int2bytes as _int2bytes
|
||||
from .common import unpack as _unpack
|
||||
from .i18n import _
|
||||
|
||||
_log = getLogger(__name__)
|
||||
del getLogger
|
||||
|
@ -520,7 +521,7 @@ class BitFieldWithOffsetAndMaskSetting(BitFieldSetting):
|
|||
class RegisterRW(object):
|
||||
__slots__ = ('register', )
|
||||
|
||||
kind = _NamedInt(0x01, 'register')
|
||||
kind = _NamedInt(0x01, _('register'))
|
||||
|
||||
def __init__(self, register):
|
||||
assert isinstance(register, int)
|
||||
|
@ -536,7 +537,7 @@ class RegisterRW(object):
|
|||
class FeatureRW(object):
|
||||
__slots__ = ('feature', 'read_fnid', 'write_fnid', 'prefix', 'no_reply')
|
||||
|
||||
kind = _NamedInt(0x02, 'feature')
|
||||
kind = _NamedInt(0x02, _('feature'))
|
||||
default_read_fnid = 0x00
|
||||
default_write_fnid = 0x10
|
||||
default_prefix = b''
|
||||
|
@ -562,7 +563,7 @@ class FeatureRW(object):
|
|||
|
||||
|
||||
class FeatureRWMap(FeatureRW):
|
||||
kind = _NamedInt(0x02, 'feature')
|
||||
kind = _NamedInt(0x02, _('feature'))
|
||||
default_read_fnid = 0x00
|
||||
default_write_fnid = 0x10
|
||||
default_key_byte_count = 1
|
||||
|
@ -730,7 +731,7 @@ class BitFieldValidator(object):
|
|||
r = _bytes2int(reply_bytes[:self.byte_count])
|
||||
value = {str(int(k)): False for k in self.options}
|
||||
m = 1
|
||||
for _ in range(8 * self.byte_count):
|
||||
for _ignore in range(8 * self.byte_count):
|
||||
if m in self.options:
|
||||
value[str(int(m))] = bool(r & m)
|
||||
m <<= 1
|
||||
|
@ -804,7 +805,7 @@ class BitFieldWithOffsetAndMaskValidator(object):
|
|||
value = _bytes2int(b[:self.byte_count])
|
||||
mask_to_opt = self._option_from_offset_mask.get(offset, {})
|
||||
m = 1
|
||||
for _ in range(8 * self.byte_count):
|
||||
for _ignore in range(8 * self.byte_count):
|
||||
if m in mask_to_opt:
|
||||
values[str(int(mask_to_opt[m]))] = bool(value & m)
|
||||
m <<= 1
|
||||
|
|
|
@ -518,7 +518,7 @@ def _feature_dpi_sliding():
|
|||
if 'raw XY' in key.flags and 'divertable' in key.flags and 'virtual' not in key.flags:
|
||||
keys.append(key.key)
|
||||
if keys:
|
||||
keys.insert(0, _NamedInt(0, 'Off'))
|
||||
keys.insert(0, _NamedInt(0, _('Off')))
|
||||
return _ChoicesV(_NamedInts.list(keys), byte_count=2)
|
||||
|
||||
return _Setting(_DPI_SLIDING, _DpiSlidingRW(), callback=_feature_dpi_sliding_callback, device_kind=(_DK.mouse, ))
|
||||
|
@ -570,7 +570,7 @@ def _feature_mouse_gesture_callback(device):
|
|||
if 'raw XY' in key.flags and 'divertable' in key.flags and 'virtual' not in key.flags:
|
||||
keys.append(key.key)
|
||||
if keys:
|
||||
keys.insert(0, _NamedInt(0, 'Off'))
|
||||
keys.insert(0, _NamedInt(0, _('Off')))
|
||||
return _ChoicesV(_NamedInts.list(keys), byte_count=2)
|
||||
|
||||
|
||||
|
@ -664,7 +664,7 @@ def _feature_divert_keys_callback(device):
|
|||
choices = {}
|
||||
for k in device.keys:
|
||||
if 'divertable' in k.flags and 'virtual' not in k.flags:
|
||||
choices[k.key] = [_NamedInt(0x00, 'Regular'), _NamedInt(0x01, 'Diverted')]
|
||||
choices[k.key] = [_NamedInt(0x00, _('Regular')), _NamedInt(0x01, _('Diverted'))]
|
||||
if not choices:
|
||||
return None
|
||||
return _ChoicesMapV(choices, key_byte_count=2, byte_count=1, mask=0x01)
|
||||
|
|
|
@ -192,12 +192,12 @@ class DiversionDialog:
|
|||
|
||||
button_box = Gtk.HBox(spacing=20)
|
||||
self.save_btn = Gtk.Button.new_from_icon_name('document-save', Gtk.IconSize.BUTTON)
|
||||
self.save_btn.set_label('Save changes')
|
||||
self.save_btn.set_label(_('Save changes'))
|
||||
self.save_btn.set_always_show_image(True)
|
||||
self.save_btn.set_sensitive(False)
|
||||
self.save_btn.set_valign(Gtk.Align.CENTER)
|
||||
self.discard_btn = Gtk.Button.new_from_icon_name('document-revert', Gtk.IconSize.BUTTON)
|
||||
self.discard_btn.set_label('Discard changes')
|
||||
self.discard_btn.set_label(_('Discard changes'))
|
||||
self.discard_btn.set_always_show_image(True)
|
||||
self.discard_btn.set_sensitive(False)
|
||||
self.discard_btn.set_valign(Gtk.Align.CENTER)
|
||||
|
|
582
po/solaar.pot
582
po/solaar.pot
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue