String changes

This commit is contained in:
Kovid Goyal 2020-05-16 12:29:31 +05:30
parent b121e7d4f5
commit b3b6272e49
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
3 changed files with 23 additions and 11 deletions

View File

@ -257,7 +257,7 @@ class ChooseLibrary(Dialog): # {{{
def browse(self): def browse(self):
d = choose_dir(self, 'choose_library_for_copy', d = choose_dir(self, 'choose_library_for_copy',
_('Choose Library')) _('Choose library'))
if d: if d:
self.le.setText(d) self.le.setText(d)

View File

@ -758,14 +758,20 @@ class User(QWidget):
username, user_data = self.username, self.user_data username, user_data = self.username, self.user_data
r = user_data[username]['restriction'] r = user_data[username]['restriction']
if r['allowed_library_names']: if r['allowed_library_names']:
m = _( libs = r['allowed_library_names']
'{} is currently only allowed to access the libraries named: {}' m = ngettext(
).format(username, ', '.join(r['allowed_library_names'])) '{} is currently only allowed to access the library named: {}',
'{} is currently only allowed to access the libraries named: {}',
len(libs)
).format(username, ', '.join(libs))
b = _('Change the allowed libraries') b = _('Change the allowed libraries')
elif r['blocked_library_names']: elif r['blocked_library_names']:
m = _( libs = r['blocked_library_names']
'{} is currently not allowed to access the libraries named: {}' m = ngettext(
).format(username, ', '.join(r['blocked_library_names'])) '{} is currently not allowed to access the library named: {}',
'{} is currently not allowed to access the libraries named: {}',
len(libs)
).format(username, ', '.join(libs))
b = _('Change the blocked libraries') b = _('Change the blocked libraries')
else: else:
m = _('{} is currently allowed access to all libraries') m = _('{} is currently allowed access to all libraries')

View File

@ -133,13 +133,19 @@ def manage_users_cli(path=None):
if r is None: if r is None:
raise SystemExit('The user {} does not exist'.format(username)) raise SystemExit('The user {} does not exist'.format(username))
if r['allowed_library_names']: if r['allowed_library_names']:
libs = r['allowed_library_names']
prints( prints(
_('{} is currently only allowed to access the libraries named: {}') ngettext(
.format(username, ', '.join(r['allowed_library_names']))) '{} is currently only allowed to access the library named: {}',
'{} is currently only allowed to access the libraries named: {}',
len(libs)).format(username, ', '.join(libs)))
if r['blocked_library_names']: if r['blocked_library_names']:
libs = r['blocked_library_names']
prints( prints(
_('{} is currently not allowed to access the libraries named: {}') ngettext(
.format(username, ', '.join(r['blocked_library_names']))) '{} is currently not allowed to access the library named: {}',
'{} is currently not allowed to access the libraries named: {}',
len(libs)).format(username, ', '.join(libs)))
if r['library_restrictions']: if r['library_restrictions']:
prints( prints(
_('{} has the following additional per-library restrictions:') _('{} has the following additional per-library restrictions:')