Daniel Brötzmann pushed to branch master at gajim / gajim

Commits:

13 changed files:

Changes:

  • gajim/common/const.py
    ... ... @@ -31,7 +31,7 @@
    31 31
     from nbxmpp.protocol import JID
    
    32 32
     
    
    33 33
     from gajim.common.i18n import _
    
    34
    -from gajim.common.i18n import Q_
    
    34
    +from gajim.common.i18n import p_
    
    35 35
     
    
    36 36
     
    
    37 37
     STOP_EVENT = True
    
    ... ... @@ -354,21 +354,21 @@ class CallType(Enum):
    354 354
     
    
    355 355
     
    
    356 356
     MUC_CREATION_EXAMPLES = [
    
    357
    -    (Q_('?Group chat name:Team'),
    
    358
    -     Q_('?Group chat description:Project discussion'),
    
    359
    -     Q_('?Group chat address:team')),
    
    360
    -    (Q_('?Group chat name:Family'),
    
    361
    -     Q_('?Group chat description:Spring gathering'),
    
    362
    -     Q_('?Group chat address:family')),
    
    363
    -    (Q_('?Group chat name:Vacation'),
    
    364
    -     Q_('?Group chat description:Trip planning'),
    
    365
    -     Q_('?Group chat address:vacation')),
    
    366
    -    (Q_('?Group chat name:Repairs'),
    
    367
    -     Q_('?Group chat description:Local help group'),
    
    368
    -     Q_('?Group chat address:repairs')),
    
    369
    -    (Q_('?Group chat name:News'),
    
    370
    -     Q_('?Group chat description:Local news and reports'),
    
    371
    -     Q_('?Group chat address:news')),
    
    357
    +    (p_('Group chat name', 'Team'),
    
    358
    +     p_('Group chat description', 'Project discussion'),
    
    359
    +     p_('Group chat address', 'team')),
    
    360
    +    (p_('Group chat name', 'Family'),
    
    361
    +     p_('Group chat description', 'Spring gathering'),
    
    362
    +     p_('Group chat address', 'family')),
    
    363
    +    (p_('Group chat name', 'Vacation'),
    
    364
    +     p_('Group chat description', 'Trip planning'),
    
    365
    +     p_('Group chat address', 'vacation')),
    
    366
    +    (p_('Group chat name', 'Repairs'),
    
    367
    +     p_('Group chat description', 'Local help group'),
    
    368
    +     p_('Group chat address', 'repairs')),
    
    369
    +    (p_('Group chat name', 'News'),
    
    370
    +     p_('Group chat description', 'Local news and reports'),
    
    371
    +     p_('Group chat address', 'news')),
    
    372 372
     ]
    
    373 373
     
    
    374 374
     
    
    ... ... @@ -921,22 +921,22 @@ def is_active(self):
    921 921
     ]
    
    922 922
     
    
    923 923
     SHOW_STRING = {
    
    924
    -    'dnd': _('Busy'),
    
    925
    -    'xa': _('Not Available'),
    
    926
    -    'chat': _('Free for Chat'),
    
    927
    -    'online': Q_('?user status:Available'),
    
    924
    +    'dnd': p_('User status', 'Busy'),
    
    925
    +    'xa': p_('User status', 'Not Available'),
    
    926
    +    'chat': p_('User status', 'Free for Chat'),
    
    927
    +    'online': p_('User status', 'Available'),
    
    928 928
         'connecting': _('Connecting'),
    
    929
    -    'away': _('Away'),
    
    929
    +    'away': p_('User status', 'Away'),
    
    930 930
         'offline': _('Offline'),
    
    931 931
     }
    
    932 932
     
    
    933 933
     SHOW_STRING_MNEMONIC = {
    
    934
    -    'dnd': _('_Busy'),
    
    935
    -    'xa': _('_Not Available'),
    
    936
    -    'chat': _('_Free for Chat'),
    
    937
    -    'online': Q_('?user status:_Available'),
    
    934
    +    'dnd': p_('User status', '_Busy'),
    
    935
    +    'xa': p_('User status', '_Not Available'),
    
    936
    +    'chat': p_('User status', '_Free for Chat'),
    
    937
    +    'online': p_('User status', '_Available'),
    
    938 938
         'connecting': _('Connecting'),
    
    939
    -    'away': _('A_way'),
    
    939
    +    'away': p_('User status', 'A_way'),
    
    940 940
         'offline': _('_Offline'),
    
    941 941
     }
    
    942 942
     
    

  • gajim/common/helpers.py
    ... ... @@ -88,7 +88,7 @@
    88 88
     from gajim.common import app
    
    89 89
     from gajim.common import configpaths
    
    90 90
     from gajim.common import iana
    
    91
    -from gajim.common.i18n import Q_
    
    91
    +from gajim.common.i18n import p_
    
    92 92
     from gajim.common.i18n import _
    
    93 93
     from gajim.common.i18n import ngettext
    
    94 94
     from gajim.common.i18n import get_rfc5646_lang
    
    ... ... @@ -183,24 +183,24 @@ def get_uf_show(show: str, use_mnemonic: bool = False) -> str:
    183 183
     
    
    184 184
     def get_uf_sub(sub: str) -> str:
    
    185 185
         if sub == 'none':
    
    186
    -        uf_sub = Q_('?Subscription we already have:None')
    
    186
    +        uf_sub = p_('Contact subscription', 'None')
    
    187 187
         elif sub == 'to':
    
    188
    -        uf_sub = _('To')
    
    188
    +        uf_sub = p_('Contact subscription', 'To')
    
    189 189
         elif sub == 'from':
    
    190
    -        uf_sub = _('From')
    
    190
    +        uf_sub = p_('Contact subscription', 'From')
    
    191 191
         elif sub == 'both':
    
    192
    -        uf_sub = _('Both')
    
    192
    +        uf_sub = p_('Contact subscription', 'Both')
    
    193 193
         else:
    
    194
    -        uf_sub = _('Unknown')
    
    194
    +        uf_sub = p_('Contact subscription', 'Unknown')
    
    195 195
     
    
    196 196
         return uf_sub
    
    197 197
     
    
    198 198
     
    
    199 199
     def get_uf_ask(ask: Union[str, None]) -> str:
    
    200 200
         if ask is None:
    
    201
    -        uf_ask = Q_('?Ask (for Subscription):None')
    
    201
    +        uf_ask = p_('Contact subscription', 'None')
    
    202 202
         elif ask == 'subscribe':
    
    203
    -        uf_ask = _('Subscribe')
    
    203
    +        uf_ask = p_('Contact subscription', 'Subscribe')
    
    204 204
         else:
    
    205 205
             uf_ask = ask
    
    206 206
     
    
    ... ... @@ -213,19 +213,19 @@ def get_uf_role(role: Union[Role, str], plural: bool = False) -> str:
    213 213
             role = role.value
    
    214 214
     
    
    215 215
         if role == 'none':
    
    216
    -        return Q_('?Group Chat Contact Role:None')
    
    216
    +        return p_('Group chat contact role', 'None')
    
    217 217
         if role == 'moderator':
    
    218 218
             if plural:
    
    219
    -            return _('Moderators')
    
    220
    -        return _('Moderator')
    
    219
    +            return p_('Group chat contact role', 'Moderators')
    
    220
    +        return p_('Group chat contact role', 'Moderator')
    
    221 221
         if role == 'participant':
    
    222 222
             if plural:
    
    223
    -            return _('Participants')
    
    224
    -        return _('Participant')
    
    223
    +            return p_('Group chat contact role', 'Participants')
    
    224
    +        return p_('Group chat contact role', 'Participant')
    
    225 225
         if role == 'visitor':
    
    226 226
             if plural:
    
    227
    -            return _('Visitors')
    
    228
    -        return _('Visitor')
    
    227
    +            return p_('Group chat contact role', 'Visitors')
    
    228
    +        return p_('Group chat contact role', 'Visitor')
    
    229 229
         return ''
    
    230 230
     
    
    231 231
     
    
    ... ... @@ -237,19 +237,19 @@ def get_uf_affiliation(affiliation: Union[Affiliation, str],
    237 237
             affiliation = affiliation.value
    
    238 238
     
    
    239 239
         if affiliation == 'none':
    
    240
    -        return Q_('?Group Chat Contact Affiliation:None')
    
    240
    +        return p_('Group chat contact affiliation', 'None')
    
    241 241
         if affiliation == 'owner':
    
    242 242
             if plural:
    
    243
    -            return _('Owners')
    
    244
    -        return _('Owner')
    
    243
    +            return p_('Group chat contact affiliation', 'Owners')
    
    244
    +        return p_('Group chat contact affiliation', 'Owner')
    
    245 245
         if affiliation == 'admin':
    
    246 246
             if plural:
    
    247
    -            return _('Administrators')
    
    248
    -        return _('Administrator')
    
    247
    +            return p_('Group chat contact affiliation', 'Administrators')
    
    248
    +        return p_('Group chat contact affiliation', 'Administrator')
    
    249 249
         if affiliation == 'member':
    
    250 250
             if plural:
    
    251
    -            return _('Members')
    
    252
    -        return _('Member')
    
    251
    +            return p_('Group chat contact affiliation', 'Members')
    
    252
    +        return p_('Group chat contact affiliation', 'Member')
    
    253 253
         return ''
    
    254 254
     
    
    255 255
     
    

  • gajim/common/i18n.py
    ... ... @@ -122,28 +122,7 @@ def is_rtl_text(text: str) -> bool:
    122 122
         return False
    
    123 123
     
    
    124 124
     
    
    125
    -def Q_(text: str) -> str:
    
    126
    -    '''
    
    127
    -    Translate the given text, optionally qualified with a special
    
    128
    -    construction, which will help translators to disambiguate between
    
    129
    -    same terms, but in different contexts.
    
    130
    -
    
    131
    -    When translated text is returned - this rudimentary construction
    
    132
    -    will be stripped off, if it's present.
    
    133
    -
    
    134
    -    Here is the construction to use:
    
    135
    -        Q_("?vcard:Unknown")
    
    136
    -
    
    137
    -    Everything between ? and : - is the qualifier to convey the context
    
    138
    -    to the translators. Everything after : - is the text itself.
    
    139
    -    '''
    
    140
    -    text = _(text)
    
    141
    -    if text.startswith('?'):
    
    142
    -        text = text.split(':', 1)[1]
    
    143
    -    return text
    
    144
    -
    
    145
    -
    
    146
    -def P_(context: str, message: str) -> str:
    
    125
    +def p_(context: str, message: str) -> str:
    
    147 126
         return _translation.pgettext(context, message)
    
    148 127
     
    
    149 128
     
    

  • gajim/common/preview_helpers.py
    ... ... @@ -42,7 +42,7 @@
    42 42
     
    
    43 43
     from gajim.common.helpers import sanitize_filename
    
    44 44
     from gajim.common.i18n import _
    
    45
    -from gajim.common.i18n import P_
    
    45
    +from gajim.common.i18n import p_
    
    46 46
     
    
    47 47
     log = logging.getLogger('gajim.c.preview_helpers')
    
    48 48
     
    
    ... ... @@ -388,13 +388,13 @@ def fmt(f: float) -> str:
    388 388
             degrees = i
    
    389 389
             return '%d°%02d′%02d′′' % (degrees, minutes, seconds)
    
    390 390
         if lat >= 0:
    
    391
    -        slat = P_('positive latitude', '%sN') % fmt(lat)
    
    391
    +        slat = p_('positive latitude', '%sN') % fmt(lat)
    
    392 392
         else:
    
    393
    -        slat = P_('negative latitude', '%sS') % fmt(-lat)
    
    393
    +        slat = p_('negative latitude', '%sS') % fmt(-lat)
    
    394 394
         if lon >= 0:
    
    395
    -        slon = P_('positive longitude', '%sE') % fmt(lon)
    
    395
    +        slon = p_('positive longitude', '%sE') % fmt(lon)
    
    396 396
         else:
    
    397
    -        slon = P_('negative longitude', '%sW') % fmt(-lon)
    
    397
    +        slon = p_('negative longitude', '%sW') % fmt(-lon)
    
    398 398
         return '%s %s' % (slat, slon)
    
    399 399
     
    
    400 400
     
    

  • gajim/gtk/accounts.py
    ... ... @@ -31,7 +31,7 @@
    31 31
     from gajim.common import passwords
    
    32 32
     from gajim.common.const import ClientState
    
    33 33
     from gajim.common.i18n import _
    
    34
    -from gajim.common.i18n import Q_
    
    34
    +from gajim.common.i18n import p_
    
    35 35
     from gajim.common.settings import AllSettingsT
    
    36 36
     from gajim.common import types
    
    37 37
     
    
    ... ... @@ -522,7 +522,7 @@ def __init__(self, account: str) -> None:
    522 522
             self._switch_state_label = Gtk.Label()
    
    523 523
             self._switch_state_label.set_xalign(0)
    
    524 524
             self._switch_state_label.set_valign(Gtk.Align.CENTER)
    
    525
    -        label_width = max(len(Q_('?switch:On')), len(Q_('?switch:Off')))
    
    525
    +        label_width = max(len(p_('Switch', 'On')), len(p_('Switch', 'Off')))
    
    526 526
             self._switch_state_label.set_width_chars(label_width)
    
    527 527
             self._set_label(account_enabled)
    
    528 528
     
    
    ... ... @@ -552,7 +552,7 @@ def enable_account(self, state: bool) -> None:
    552 552
             self._set_label(state)
    
    553 553
     
    
    554 554
         def _set_label(self, active: bool) -> None:
    
    555
    -        text = Q_('?switch:On') if active else Q_('?switch:Off')
    
    555
    +        text = p_('Switch', 'On') if active else p_('Switch', 'Off')
    
    556 556
             self._switch_state_label.set_text(text)
    
    557 557
     
    
    558 558
         def _on_enable_switch(self,
    

  • gajim/gtk/advanced_config.py
    ... ... @@ -30,7 +30,7 @@
    30 30
     
    
    31 31
     from gajim.common import app
    
    32 32
     from gajim.common.i18n import _
    
    33
    -from gajim.common.i18n import Q_
    
    33
    +from gajim.common.i18n import p_
    
    34 34
     
    
    35 35
     from gajim.common.setting_values import ADVANCED_SETTINGS
    
    36 36
     from gajim.common.setting_values import APP_SETTINGS
    
    ... ... @@ -53,9 +53,9 @@ class Column(IntEnum):
    53 53
     
    
    54 54
     
    
    55 55
     SETTING_TYPES = {
    
    56
    -    bool: Q_('?config type:Boolean'),
    
    57
    -    int: Q_('?config type:Integer'),
    
    58
    -    str: Q_('?config type:Text'),
    
    56
    +    bool: p_('Configuration type', 'Boolean'),
    
    57
    +    int: p_('Configuration type', 'Integer'),
    
    58
    +    str: p_('Configuration type', 'Text'),
    
    59 59
     }
    
    60 60
     
    
    61 61
     
    
    ... ... @@ -81,7 +81,7 @@ def __init__(self) -> None:
    81 81
     
    
    82 82
             renderer_text = Gtk.CellRendererText()
    
    83 83
             renderer_text.set_property('ellipsize', Pango.EllipsizeMode.END)
    
    84
    -        col = Gtk.TreeViewColumn(Q_('?config:Preference Name'),
    
    84
    +        col = Gtk.TreeViewColumn(p_('Configuration', 'Preference Name'),
    
    85 85
                                      renderer_text, text=0)
    
    86 86
             treeview.insert_column(col, -1)
    
    87 87
             col.set_cell_data_func(renderer_text,
    
    ... ... @@ -94,7 +94,7 @@ def __init__(self) -> None:
    94 94
             self.renderer_text.connect('edited', self._on_config_edited)
    
    95 95
             self.renderer_text.set_property('ellipsize', Pango.EllipsizeMode.END)
    
    96 96
             col = Gtk.TreeViewColumn(
    
    97
    -            Q_('?config:Value'), self.renderer_text, text=1)
    
    97
    +            p_('Configuration', 'Value'), self.renderer_text, text=1)
    
    98 98
             treeview.insert_column(col, -1)
    
    99 99
             col.set_cell_data_func(self.renderer_text,
    
    100 100
                                    self._value_column_data_callback)
    
    ... ... @@ -103,7 +103,8 @@ def __init__(self) -> None:
    103 103
             col.set_resizable(True)
    
    104 104
     
    
    105 105
             renderer_text = Gtk.CellRendererText()
    
    106
    -        col = Gtk.TreeViewColumn(Q_('?config:Type'), renderer_text, text=2)
    
    106
    +        col = Gtk.TreeViewColumn(
    
    107
    +            p_('Configuration', 'Type'), renderer_text, text=2)
    
    107 108
             treeview.insert_column(col, -1)
    
    108 109
             col.set_sizing(Gtk.TreeViewColumnSizing.FIXED)
    
    109 110
     
    
    ... ... @@ -159,7 +160,8 @@ def _on_treeview_selection_changed(self,
    159 160
             setting = model[iter_][Column.NAME]
    
    160 161
             desc = ADVANCED_SETTINGS['app'][setting]
    
    161 162
     
    
    162
    -        self._ui.description.set_text(desc or Q_('?config description:None'))
    
    163
    +        self._ui.description.set_text(
    
    164
    +            desc or p_('Configuration description', 'None'))
    
    163 165
             self._ui.reset_button.set_sensitive(not model[iter_][Column.IS_DEFAULT])
    
    164 166
     
    
    165 167
         def _on_treeview_row_activated(self,
    

  • gajim/gtk/conversation/rows/widgets.py
    ... ... @@ -27,7 +27,7 @@
    27 27
     
    
    28 28
     from gajim.common import app
    
    29 29
     from gajim.common.const import AvatarSize
    
    30
    -from gajim.common.i18n import Q_
    
    30
    +from gajim.common.i18n import p_
    
    31 31
     from gajim.common.modules.contacts import GroupchatContact
    
    32 32
     from gajim.common.types import ChatContactT
    
    33 33
     
    
    ... ... @@ -155,7 +155,7 @@ def set_receipt_icon_visible(self, visible: bool) -> None:
    155 155
             self._marker_image.set_visible(visible)
    
    156 156
             self._marker_image.set_from_icon_name(
    
    157 157
                 'feather-check-symbolic', Gtk.IconSize.MENU)
    
    158
    -        self._marker_image.set_tooltip_text(Q_('?Message state:Received'))
    
    158
    +        self._marker_image.set_tooltip_text(p_('Message state', 'Received'))
    
    159 159
     
    
    160 160
         def set_correction_icon_visible(self, visible: bool) -> None:
    
    161 161
             self._correction_image.set_visible(visible)
    

  • gajim/gtk/groupchat_info.py
    ... ... @@ -27,7 +27,7 @@
    27 27
     
    
    28 28
     from gajim.common import app
    
    29 29
     from gajim.common.i18n import _
    
    30
    -from gajim.common.i18n import Q_
    
    30
    +from gajim.common.i18n import p_
    
    31 31
     from gajim.common.helpers import open_uri
    
    32 32
     from gajim.common.helpers import get_groupchat_name
    
    33 33
     from gajim.common.const import RFC5646_LANGUAGE_TAGS
    
    ... ... @@ -40,63 +40,63 @@
    40 40
     MUC_FEATURES = {
    
    41 41
         'muc_open': (
    
    42 42
             'feather-globe-symbolic',
    
    43
    -        Q_('?Group chat feature:Open'),
    
    43
    +        p_('Group chat feature', 'Open'),
    
    44 44
             _('Anyone can join this group chat')),
    
    45 45
         'muc_membersonly': (
    
    46 46
             'feather-user-check-symbolic',
    
    47
    -        Q_('?Group chat feature:Members Only'),
    
    47
    +        p_('Group chat feature', 'Members Only'),
    
    48 48
             _('This group chat is restricted '
    
    49 49
               'to members only')),
    
    50 50
         'muc_nonanonymous': (
    
    51 51
             'feather-shield-off-symbolic',
    
    52
    -        Q_('?Group chat feature:Not Anonymous'),
    
    52
    +        p_('Group chat feature', 'Not Anonymous'),
    
    53 53
             _('All other group chat participants '
    
    54 54
               'can see your XMPP address')),
    
    55 55
         'muc_semianonymous': (
    
    56 56
             'feather-shield-symbolic',
    
    57
    -        Q_('?Group chat feature:Semi-Anonymous'),
    
    57
    +        p_('Group chat feature', 'Semi-Anonymous'),
    
    58 58
             _('Only moderators can see your XMPP address')),
    
    59 59
         'muc_moderated': (
    
    60 60
             'feather-mic-off-symbolic',
    
    61
    -        Q_('?Group chat feature:Moderated'),
    
    61
    +        p_('Group chat feature', 'Moderated'),
    
    62 62
             _('Participants entering this group chat need '
    
    63 63
               'to request permission to send messages')),
    
    64 64
         'muc_unmoderated': (
    
    65 65
             'feather-mic-symbolic',
    
    66
    -        Q_('?Group chat feature:Not Moderated'),
    
    66
    +        p_('Group chat feature', 'Not Moderated'),
    
    67 67
             _('Participants entering this group chat are '
    
    68 68
               'allowed to send messages')),
    
    69 69
         'muc_public': (
    
    70 70
             'feather-eye-symbolic',
    
    71
    -        Q_('?Group chat feature:Public'),
    
    71
    +        p_('Group chat feature', 'Public'),
    
    72 72
             _('Group chat can be found via search')),
    
    73 73
         'muc_hidden': (
    
    74 74
             'feather-eye-off-symbolic',
    
    75
    -        Q_('?Group chat feature:Hidden'),
    
    75
    +        p_('Group chat feature', 'Hidden'),
    
    76 76
             _('This group chat can not be found via search')),
    
    77 77
         'muc_passwordprotected': (
    
    78 78
             'feather-lock-symbolic',
    
    79
    -        Q_('?Group chat feature:Password Required'),
    
    79
    +        p_('Group chat feature', 'Password Required'),
    
    80 80
             _('This group chat '
    
    81 81
               'does require a password upon entry')),
    
    82 82
         'muc_unsecured': (
    
    83 83
             'feather-unlock-symbolic',
    
    84
    -        Q_('?Group chat feature:No Password Required'),
    
    84
    +        p_('Group chat feature', 'No Password Required'),
    
    85 85
             _('This group chat does not require '
    
    86 86
               'a password upon entry')),
    
    87 87
         'muc_persistent': (
    
    88 88
             'feather-hard-drive-symbolic',
    
    89
    -        Q_('?Group chat feature:Persistent'),
    
    89
    +        p_('Group chat feature', 'Persistent'),
    
    90 90
             _('This group chat persists '
    
    91 91
               'even if there are no participants')),
    
    92 92
         'muc_temporary': (
    
    93 93
             'feather-clock-symbolic',
    
    94
    -        Q_('?Group chat feature:Temporary'),
    
    94
    +        p_('Group chat feature', 'Temporary'),
    
    95 95
             _('This group chat will be destroyed '
    
    96 96
               'once the last participant left')),
    
    97 97
         'mam': (
    
    98 98
             'feather-server-symbolic',
    
    99
    -        Q_('?Group chat feature:Archiving'),
    
    99
    +        p_('Group chat feature', 'Archiving'),
    
    100 100
             _('Messages are archived on the server')),
    
    101 101
     }
    
    102 102
     
    

  • gajim/gtk/menus.py
    ... ... @@ -39,7 +39,7 @@
    39 39
     from gajim.common.helpers import is_role_change_allowed
    
    40 40
     from gajim.common.helpers import jid_is_blocked
    
    41 41
     from gajim.common.i18n import _
    
    42
    -from gajim.common.i18n import Q_
    
    42
    +from gajim.common.i18n import p_
    
    43 43
     from gajim.common.i18n import get_short_lang_code
    
    44 44
     from gajim.common.const import URIType
    
    45 45
     from gajim.common.const import XmppUriQuery
    
    ... ... @@ -617,10 +617,12 @@ def get_chat_row_menu(contact: types.ChatContactT,
    617 617
         timestamp_formatted = timestamp.strftime(time_format)
    
    618 618
         copy_text = f'{timestamp_formatted} - {name}: {text}'
    
    619 619
         menu_items.append(
    
    620
    -        (Q_('?Message row action:Copy'), 'win.copy-message', f'"{copy_text}"'))
    
    620
    +        (p_('Message row action', 'Copy'),
    
    621
    +         'win.copy-message',
    
    622
    +         f'"{copy_text}"'))
    
    621 623
     
    
    622 624
         menu_items.append(
    
    623
    -        (Q_('?Message row action:Select Messages…'),
    
    625
    +        (p_('Message row action', 'Select Messages…'),
    
    624 626
              'win.activate-message-selection',
    
    625 627
              GLib.Variant('u', log_line_id or 0)))
    
    626 628
     
    
    ... ... @@ -634,7 +636,7 @@ def get_chat_row_menu(contact: types.ChatContactT,
    634 636
                 show_quote = False
    
    635 637
         if show_quote:
    
    636 638
             menu_items.append((
    
    637
    -            Q_('?Message row action:Quote…'),
    
    639
    +            p_('Message row action', 'Quote…'),
    
    638 640
                 'win.quote',
    
    639 641
                 f'"{text}"'))
    
    640 642
     
    
    ... ... @@ -644,7 +646,7 @@ def get_chat_row_menu(contact: types.ChatContactT,
    644 646
                 contact, message_id)
    
    645 647
         if show_correction:
    
    646 648
             menu_items.append((
    
    647
    -            Q_('?Message row action:Correct…'), 'win.correct-message', None))
    
    649
    +            p_('Message row action', 'Correct…'), 'win.correct-message', None))
    
    648 650
     
    
    649 651
         show_retract = False
    
    650 652
         if isinstance(contact, GroupchatContact) and contact.is_joined:
    
    ... ... @@ -665,7 +667,9 @@ def get_chat_row_menu(contact: types.ChatContactT,
    665 667
                 jid=contact.jid,
    
    666 668
                 stanza_id=stanza_id)
    
    667 669
             menu_items.append((
    
    668
    -            Q_('?Message row action:Retract…'), 'win.retract-message', param))
    
    670
    +            p_('Message row action', 'Retract…'),
    
    671
    +            'win.retract-message',
    
    672
    +            param))
    
    669 673
     
    
    670 674
         menu = GajimMenu.from_list(menu_items)
    
    671 675
         return menu
    

  • gajim/gtk/profile.py
    ... ... @@ -36,7 +36,7 @@
    36 36
     from gajim.common import app
    
    37 37
     from gajim.common.const import AvatarSize
    
    38 38
     from gajim.common.i18n import _
    
    39
    -from gajim.common.i18n import Q_
    
    39
    +from gajim.common.i18n import p_
    
    40 40
     
    
    41 41
     from gajim.gui.avatar import clip_circle
    
    42 42
     from gajim.gui.avatar_selector import AvatarSelector
    
    ... ... @@ -49,19 +49,19 @@
    49 49
     log = logging.getLogger('gajim.gui.profile')
    
    50 50
     
    
    51 51
     MENU_DICT = {
    
    52
    -    'fn': Q_('?profile:Full Name'),
    
    52
    +    'fn': p_('Profile', 'Full Name'),
    
    53 53
         'bday': _('Birthday'),
    
    54
    -    'gender': Q_('?profile:Gender'),
    
    55
    -    'adr': Q_('?profile:Address'),
    
    54
    +    'gender': p_('Profile', 'Gender'),
    
    55
    +    'adr': p_('Profile', 'Address'),
    
    56 56
         'email': _('Email'),
    
    57
    -    'impp': Q_('?profile:IM Address'),
    
    57
    +    'impp': p_('Profile', 'IM Address'),
    
    58 58
         'tel': _('Phone No.'),
    
    59
    -    'org': Q_('?profile:Organisation'),
    
    60
    -    'title': Q_('?profile:Title'),
    
    61
    -    'role': Q_('?profile:Role'),
    
    59
    +    'org': p_('Profile', 'Organisation'),
    
    60
    +    'title': p_('Profile', 'Title'),
    
    61
    +    'role': p_('Profile', 'Role'),
    
    62 62
         'url': _('URL'),
    
    63
    -    'key': Q_('?profile:Public Encryption Key'),
    
    64
    -    'note': Q_('?profile:Note'),
    
    63
    +    'key': p_('Profile', 'Public Encryption Key'),
    
    64
    +    'note': p_('Profile', 'Note'),
    
    65 65
     }
    
    66 66
     
    
    67 67
     
    

  • gajim/gtk/settings.py
    ... ... @@ -34,7 +34,7 @@
    34 34
     from gajim.common import app
    
    35 35
     from gajim.common import passwords
    
    36 36
     from gajim.common.i18n import _
    
    37
    -from gajim.common.i18n import Q_
    
    37
    +from gajim.common.i18n import p_
    
    38 38
     from gajim.common.setting_values import AllSettingsT
    
    39 39
     
    
    40 40
     from .util import get_image_button
    
    ... ... @@ -450,7 +450,7 @@ def on_switch(self, switch: Gtk.Switch, *args: Any) -> None:
    450 450
             self._set_label(value)
    
    451 451
     
    
    452 452
         def _set_label(self, active: bool) -> None:
    
    453
    -        text = Q_('?switch:On') if active else Q_('?switch:Off')
    
    453
    +        text = p_('Switch', 'On') if active else p_('Switch', 'Off')
    
    454 454
             self._switch_state_label.set_text(text)
    
    455 455
     
    
    456 456
     
    
    ... ... @@ -871,7 +871,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None:
    871 871
         def get_setting_value(self) -> str:
    
    872 872
             custom = app.settings.get_account_setting(self.account,
    
    873 873
                                                       'use_custom_host')
    
    874
    -        return Q_('?switch:On') if custom else Q_('?switch:Off')
    
    874
    +        return p_('Switch', 'On') if custom else p_('Switch', 'Off')
    
    875 875
     
    
    876 876
     
    
    877 877
     class ChangePasswordSetting(DialogSetting):
    
    ... ... @@ -897,7 +897,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None:
    897 897
     
    
    898 898
         def get_setting_value(self) -> str:
    
    899 899
             value = app.settings.get('autoaway')
    
    900
    -        return Q_('?switch:On') if value else Q_('?switch:Off')
    
    900
    +        return p_('Switch', 'On') if value else p_('Switch', 'Off')
    
    901 901
     
    
    902 902
     
    
    903 903
     class CutstomAutoExtendedAwaySetting(DialogSetting):
    
    ... ... @@ -906,7 +906,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None:
    906 906
     
    
    907 907
         def get_setting_value(self) -> str:
    
    908 908
             value = app.settings.get('autoxa')
    
    909
    -        return Q_('?switch:On') if value else Q_('?switch:Off')
    
    909
    +        return p_('Switch', 'On') if value else p_('Switch', 'Off')
    
    910 910
     
    
    911 911
     
    
    912 912
     class CustomStunServerSetting(DialogSetting):
    
    ... ... @@ -915,7 +915,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None:
    915 915
     
    
    916 916
         def get_setting_value(self) -> str:
    
    917 917
             value = app.settings.get('use_stun_server')
    
    918
    -        return Q_('?switch:On') if value else Q_('?switch:Off')
    
    918
    +        return p_('Switch', 'On') if value else p_('Switch', 'Off')
    
    919 919
     
    
    920 920
     
    
    921 921
     class NotificationsSetting(DialogSetting):
    
    ... ... @@ -924,4 +924,4 @@ def __init__(self, *args: Any, **kwargs: Any) -> None:
    924 924
     
    
    925 925
         def get_setting_value(self) -> str:
    
    926 926
             value = app.settings.get('show_notifications')
    
    927
    -        return Q_('?switch:On') if value else Q_('?switch:Off')
    927
    +        return p_('Switch', 'On') if value else p_('Switch', 'Off')

  • gajim/gtk/tooltips.py
    ... ... @@ -42,7 +42,7 @@
    42 42
     from gajim.common import types
    
    43 43
     from gajim.common import helpers
    
    44 44
     from gajim.common.const import AvatarSize
    
    45
    -from gajim.common.i18n import Q_
    
    45
    +from gajim.common.i18n import p_
    
    46 46
     from gajim.common.i18n import _
    
    47 47
     from gajim.common.file_props import FileProp
    
    48 48
     
    
    ... ... @@ -316,26 +316,26 @@ def _create_tooltip(self, file_prop: FileProp, _sid: str) -> Gtk.Grid:
    316 316
             assert file_prop.tt_account is not None
    
    317 317
             client = app.get_client(file_prop.tt_account)
    
    318 318
             if file_prop.type_ == 'r':
    
    319
    -            type_ = Q_('?Noun:Download')
    
    319
    +            type_ = p_('Noun', 'Download')
    
    320 320
                 actor = _('Sender: ')
    
    321 321
                 sender = JID.from_string(file_prop.sender)
    
    322 322
                 name = client.get_module('Contacts').get_contact(sender.bare).name
    
    323 323
             else:
    
    324
    -            type_ = Q_('?Noun:Upload')
    
    324
    +            type_ = p_('Noun', 'Upload')
    
    325 325
                 actor = _('Recipient: ')
    
    326 326
                 receiver = JID.from_string(file_prop.receiver)
    
    327 327
                 name = client.get_module('Contacts').get_contact(
    
    328 328
                     receiver.bare).name
    
    329
    -        properties.append((Q_('?transfer type:Type: '), type_))
    
    329
    +        properties.append((p_('File transfer type', 'Type: '), type_))
    
    330 330
             properties.append((actor, GLib.markup_escape_text(name)))
    
    331 331
     
    
    332 332
             transferred_len = file_prop.received_len
    
    333 333
             if not transferred_len:
    
    334 334
                 transferred_len = 0
    
    335
    -        properties.append((Q_('?transfer status:Transferred: '),
    
    335
    +        properties.append((p_('File transfer state', 'Transferred: '),
    
    336 336
                                GLib.format_size_full(transferred_len, self.units)))
    
    337 337
             status = self._get_current_status(file_prop)
    
    338
    -        properties.append((Q_('?transfer status:Status: '), status))
    
    338
    +        properties.append((p_('File transfer state', 'Status: '), status))
    
    339 339
             file_desc = file_prop.desc or ''
    
    340 340
             properties.append((_('Description: '),
    
    341 341
                                GLib.markup_escape_text(file_desc)))
    
    ... ... @@ -361,17 +361,17 @@ def _create_tooltip(self, file_prop: FileProp, _sid: str) -> Gtk.Grid:
    361 361
         @staticmethod
    
    362 362
         def _get_current_status(file_prop: FileProp) -> str:
    
    363 363
             if file_prop.stopped:
    
    364
    -            return Q_('?transfer status:Aborted')
    
    364
    +            return p_('File transfer state', 'Aborted')
    
    365 365
             if file_prop.completed:
    
    366
    -            return Q_('?transfer status:Completed')
    
    366
    +            return p_('File transfer state', 'Completed')
    
    367 367
             if file_prop.paused:
    
    368
    -            return Q_('?transfer status:Paused')
    
    368
    +            return p_('File transfer state', 'Paused')
    
    369 369
             if file_prop.stalled:
    
    370 370
                 # stalled is not paused. it is like 'frozen' it stopped alone
    
    371
    -            return Q_('?transfer status:Stalled')
    
    371
    +            return p_('File transfer state', 'Stalled')
    
    372 372
     
    
    373 373
             if file_prop.connected:
    
    374 374
                 if file_prop.started:
    
    375
    -                return Q_('?transfer status:Transferring')
    
    376
    -            return Q_('?transfer status:Not started')
    
    377
    -        return Q_('?transfer status:Not started')
    375
    +                return p_('File transfer state', 'Transferring')
    
    376
    +            return p_('File transfer state', 'Not started')
    
    377
    +        return p_('File transfer state', 'Not started')

  • gajim/gtk/vcard_grid.py
    ... ... @@ -25,7 +25,7 @@
    25 25
     from nbxmpp.modules.vcard4 import VCard
    
    26 26
     
    
    27 27
     from gajim.common.i18n import _
    
    28
    -from gajim.common.i18n import Q_
    
    28
    +from gajim.common.i18n import p_
    
    29 29
     from gajim.common.const import URIType
    
    30 30
     from gajim.common.helpers import open_uri
    
    31 31
     from gajim.common.helpers import parse_uri
    
    ... ... @@ -40,16 +40,16 @@
    40 40
         'n': _('Name'),
    
    41 41
         'bday': _('Birthday'),
    
    42 42
         'gender': _('Gender'),
    
    43
    -    'adr': Q_('?profile:Address'),
    
    43
    +    'adr': p_('Profile', 'Address'),
    
    44 44
         'tel': _('Phone No.'),
    
    45 45
         'email': _('Email'),
    
    46
    -    'impp': _('IM Address'),
    
    47
    -    'title': Q_('?profile:Title'),
    
    48
    -    'role': Q_('?profile:Role'),
    
    49
    -    'org': _('Organisation'),
    
    50
    -    'note': Q_('?profile:Note'),
    
    46
    +    'impp': p_('Profile', 'IM Address'),
    
    47
    +    'title': p_('Profile', 'Title'),
    
    48
    +    'role': p_('Profile', 'Role'),
    
    49
    +    'org': p_('Profile', 'Organisation'),
    
    50
    +    'note': p_('Profile', ':Note'),
    
    51 51
         'url': _('URL'),
    
    52
    -    'key': Q_('?profile:Public Encryption Key'),
    
    52
    +    'key': p_('Profile', 'Public Encryption Key'),
    
    53 53
     }
    
    54 54
     
    
    55 55
     
    
    ... ... @@ -118,8 +118,8 @@
    118 118
     SEX_VALUES = {
    
    119 119
         'M': _('Male'),
    
    120 120
         'F': _('Female'),
    
    121
    -    'O': Q_('?Gender:Other'),
    
    122
    -    'N': Q_('?Gender:None'),
    
    121
    +    'O': p_('Gender', 'Other'),
    
    122
    +    'N': p_('Gender', 'None'),
    
    123 123
         'U': _('Unknown')
    
    124 124
     }
    
    125 125