i18n: mark more strings as translatable

This commit is contained in:
Peter F. Patel-Schneider 2021-08-06 09:21:08 -04:00
parent ee4275f45c
commit a1874c572b
23 changed files with 7140 additions and 4623 deletions

View File

@ -30,6 +30,7 @@
from __future__ import absolute_import, division, print_function, unicode_literals from __future__ import absolute_import, division, print_function, unicode_literals
from .descriptors import DEVICES as _DEVICES 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 # 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 # 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, 'product_id': product_id,
'usb_interface': 2, 'usb_interface': 2,
'hid_driver': _DRIVER, # noqa: F821 'hid_driver': _DRIVER, # noqa: F821
'name': 'Unifying Receiver' 'name': _('Unifying Receiver')
} }
_nano_receiver = lambda product_id: { _nano_receiver = lambda product_id: {
@ -54,7 +55,7 @@ _nano_receiver = lambda product_id: {
'product_id': product_id, 'product_id': product_id,
'usb_interface': 1, 'usb_interface': 1,
'hid_driver': _DRIVER, # noqa: F821 'hid_driver': _DRIVER, # noqa: F821
'name': 'Nano Receiver', 'name': _('Nano Receiver'),
'may_unpair': False, 'may_unpair': False,
're_pairs': True 're_pairs': True
} }
@ -64,7 +65,7 @@ _nano_receiver_no_unpair = lambda product_id: {
'product_id': product_id, 'product_id': product_id,
'usb_interface': 1, 'usb_interface': 1,
'hid_driver': _DRIVER, # noqa: F821 'hid_driver': _DRIVER, # noqa: F821
'name': 'Nano Receiver', 'name': _('Nano Receiver'),
'may_unpair': False, 'may_unpair': False,
'unpair': False, 'unpair': False,
're_pairs': True 're_pairs': True
@ -75,7 +76,7 @@ _nano_receiver_max2 = lambda product_id: {
'product_id': product_id, 'product_id': product_id,
'usb_interface': 1, 'usb_interface': 1,
'hid_driver': _DRIVER, # noqa: F821 'hid_driver': _DRIVER, # noqa: F821
'name': 'Nano Receiver', 'name': _('Nano Receiver'),
'max_devices': 2, 'max_devices': 2,
'may_unpair': False, 'may_unpair': False,
're_pairs': True 're_pairs': True
@ -86,7 +87,7 @@ _nano_receiver_maxn = lambda product_id, max: {
'product_id': product_id, 'product_id': product_id,
'usb_interface': 1, 'usb_interface': 1,
'hid_driver': _DRIVER, # noqa: F821 'hid_driver': _DRIVER, # noqa: F821
'name': 'Nano Receiver', 'name': _('Nano Receiver'),
'max_devices': max, 'max_devices': max,
'may_unpair': False, 'may_unpair': False,
're_pairs': True 're_pairs': True
@ -97,7 +98,7 @@ _lenovo_receiver = lambda product_id: {
'product_id': product_id, 'product_id': product_id,
'usb_interface': 1, 'usb_interface': 1,
'hid_driver': _DRIVER, # noqa: F821 'hid_driver': _DRIVER, # noqa: F821
'name': 'Nano Receiver' 'name': _('Nano Receiver')
} }
_lightspeed_receiver = lambda product_id: { _lightspeed_receiver = lambda product_id: {
@ -105,7 +106,7 @@ _lightspeed_receiver = lambda product_id: {
'product_id': product_id, 'product_id': product_id,
'usb_interface': 2, 'usb_interface': 2,
'hid_driver': _DRIVER, # noqa: F821 'hid_driver': _DRIVER, # noqa: F821
'name': 'Lightspeed Receiver' 'name': _('Lightspeed Receiver')
} }
_ex100_receiver = lambda product_id: { _ex100_receiver = lambda product_id: {
@ -113,7 +114,7 @@ _ex100_receiver = lambda product_id: {
'product_id': product_id, 'product_id': product_id,
'usb_interface': 1, 'usb_interface': 1,
'hid_driver': _DRIVER, # noqa: F821 'hid_driver': _DRIVER, # noqa: F821
'name': 'EX100 Receiver 27 Mhz', 'name': _('EX100 Receiver 27 Mhz'),
'max_devices': 4, 'max_devices': 4,
'may_unpair': False, 'may_unpair': False,
're_pairs': True, 're_pairs': True,

View File

@ -38,17 +38,24 @@ _DUMMY = (
_('empty'), _('empty'),
_('critical'), _('critical'),
_('low'), _('low'),
_('average'),
_('good'), _('good'),
_('full'), _('full'),
# battery charging statuses # battery charging statuses
_('discharging'), _('discharging'),
_('recharging'), _('recharging'),
_('charging'),
_('not charging'),
_('almost full'), _('almost full'),
_('charged'), _('charged'),
_('slow recharge'), _('slow recharge'),
_('invalid battery'), _('invalid battery'),
_('thermal error'), _('thermal error'),
_('error'),
_('standard'),
_('fast'),
_('slow'),
# pairing errors # pairing errors
_('device timeout'), _('device timeout'),

View File

@ -33,6 +33,7 @@ from .common import NamedInts as _NamedInts
from .common import bytes2int as _bytes2int from .common import bytes2int as _bytes2int
from .common import int2bytes as _int2bytes from .common import int2bytes as _int2bytes
from .common import unpack as _unpack from .common import unpack as _unpack
from .i18n import _
_log = getLogger(__name__) _log = getLogger(__name__)
del getLogger del getLogger
@ -520,7 +521,7 @@ class BitFieldWithOffsetAndMaskSetting(BitFieldSetting):
class RegisterRW(object): class RegisterRW(object):
__slots__ = ('register', ) __slots__ = ('register', )
kind = _NamedInt(0x01, 'register') kind = _NamedInt(0x01, _('register'))
def __init__(self, register): def __init__(self, register):
assert isinstance(register, int) assert isinstance(register, int)
@ -536,7 +537,7 @@ class RegisterRW(object):
class FeatureRW(object): class FeatureRW(object):
__slots__ = ('feature', 'read_fnid', 'write_fnid', 'prefix', 'no_reply') __slots__ = ('feature', 'read_fnid', 'write_fnid', 'prefix', 'no_reply')
kind = _NamedInt(0x02, 'feature') kind = _NamedInt(0x02, _('feature'))
default_read_fnid = 0x00 default_read_fnid = 0x00
default_write_fnid = 0x10 default_write_fnid = 0x10
default_prefix = b'' default_prefix = b''
@ -562,7 +563,7 @@ class FeatureRW(object):
class FeatureRWMap(FeatureRW): class FeatureRWMap(FeatureRW):
kind = _NamedInt(0x02, 'feature') kind = _NamedInt(0x02, _('feature'))
default_read_fnid = 0x00 default_read_fnid = 0x00
default_write_fnid = 0x10 default_write_fnid = 0x10
default_key_byte_count = 1 default_key_byte_count = 1
@ -730,7 +731,7 @@ class BitFieldValidator(object):
r = _bytes2int(reply_bytes[:self.byte_count]) r = _bytes2int(reply_bytes[:self.byte_count])
value = {str(int(k)): False for k in self.options} value = {str(int(k)): False for k in self.options}
m = 1 m = 1
for _ in range(8 * self.byte_count): for _ignore in range(8 * self.byte_count):
if m in self.options: if m in self.options:
value[str(int(m))] = bool(r & m) value[str(int(m))] = bool(r & m)
m <<= 1 m <<= 1
@ -804,7 +805,7 @@ class BitFieldWithOffsetAndMaskValidator(object):
value = _bytes2int(b[:self.byte_count]) value = _bytes2int(b[:self.byte_count])
mask_to_opt = self._option_from_offset_mask.get(offset, {}) mask_to_opt = self._option_from_offset_mask.get(offset, {})
m = 1 m = 1
for _ in range(8 * self.byte_count): for _ignore in range(8 * self.byte_count):
if m in mask_to_opt: if m in mask_to_opt:
values[str(int(mask_to_opt[m]))] = bool(value & m) values[str(int(mask_to_opt[m]))] = bool(value & m)
m <<= 1 m <<= 1

View File

@ -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: if 'raw XY' in key.flags and 'divertable' in key.flags and 'virtual' not in key.flags:
keys.append(key.key) keys.append(key.key)
if keys: if keys:
keys.insert(0, _NamedInt(0, 'Off')) keys.insert(0, _NamedInt(0, _('Off')))
return _ChoicesV(_NamedInts.list(keys), byte_count=2) return _ChoicesV(_NamedInts.list(keys), byte_count=2)
return _Setting(_DPI_SLIDING, _DpiSlidingRW(), callback=_feature_dpi_sliding_callback, device_kind=(_DK.mouse, )) 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: if 'raw XY' in key.flags and 'divertable' in key.flags and 'virtual' not in key.flags:
keys.append(key.key) keys.append(key.key)
if keys: if keys:
keys.insert(0, _NamedInt(0, 'Off')) keys.insert(0, _NamedInt(0, _('Off')))
return _ChoicesV(_NamedInts.list(keys), byte_count=2) return _ChoicesV(_NamedInts.list(keys), byte_count=2)
@ -664,7 +664,7 @@ def _feature_divert_keys_callback(device):
choices = {} choices = {}
for k in device.keys: for k in device.keys:
if 'divertable' in k.flags and 'virtual' not in k.flags: 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: if not choices:
return None return None
return _ChoicesMapV(choices, key_byte_count=2, byte_count=1, mask=0x01) return _ChoicesMapV(choices, key_byte_count=2, byte_count=1, mask=0x01)

View File

@ -192,12 +192,12 @@ class DiversionDialog:
button_box = Gtk.HBox(spacing=20) button_box = Gtk.HBox(spacing=20)
self.save_btn = Gtk.Button.new_from_icon_name('document-save', Gtk.IconSize.BUTTON) 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_always_show_image(True)
self.save_btn.set_sensitive(False) self.save_btn.set_sensitive(False)
self.save_btn.set_valign(Gtk.Align.CENTER) 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 = 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_always_show_image(True)
self.discard_btn.set_sensitive(False) self.discard_btn.set_sensitive(False)
self.discard_btn.set_valign(Gtk.Align.CENTER) self.discard_btn.set_valign(Gtk.Align.CENTER)

590
po/cs.po

File diff suppressed because it is too large Load Diff

582
po/da.po

File diff suppressed because it is too large Load Diff

1768
po/de.po

File diff suppressed because it is too large Load Diff

582
po/el.po

File diff suppressed because it is too large Load Diff

582
po/es.po

File diff suppressed because it is too large Load Diff

584
po/fi.po

File diff suppressed because it is too large Load Diff

590
po/fr.po

File diff suppressed because it is too large Load Diff

582
po/hr.po

File diff suppressed because it is too large Load Diff

600
po/it.po

File diff suppressed because it is too large Load Diff

582
po/nb.po

File diff suppressed because it is too large Load Diff

590
po/nl.po

File diff suppressed because it is too large Load Diff

582
po/nn.po

File diff suppressed because it is too large Load Diff

582
po/pt.po

File diff suppressed because it is too large Load Diff

594
po/ro.po

File diff suppressed because it is too large Load Diff

582
po/ru.po

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

582
po/sv.po

File diff suppressed because it is too large Load Diff

582
po/tr.po

File diff suppressed because it is too large Load Diff