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):
d = choose_dir(self, 'choose_library_for_copy',
_('Choose Library'))
_('Choose library'))
if d:
self.le.setText(d)

View File

@ -758,14 +758,20 @@ class User(QWidget):
username, user_data = self.username, self.user_data
r = user_data[username]['restriction']
if r['allowed_library_names']:
m = _(
'{} is currently only allowed to access the libraries named: {}'
).format(username, ', '.join(r['allowed_library_names']))
libs = r['allowed_library_names']
m = ngettext(
'{} 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')
elif r['blocked_library_names']:
m = _(
'{} is currently not allowed to access the libraries named: {}'
).format(username, ', '.join(r['blocked_library_names']))
libs = r['blocked_library_names']
m = ngettext(
'{} 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')
else:
m = _('{} is currently allowed access to all libraries')

View File

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