Fix untranslatable string

The word "number" is not marked for translation, we cannot just add
it this way to a string.
Instead create two separate strings.

Change-Id: I0396f1d7405987ed1c57f0344e1c5ebeca30a2e3
Closes-Bug: #1444327
This commit is contained in:
Andreas Jaeger 2015-04-15 09:43:26 +02:00 committed by Alistair Coles
parent 5ef2e9ec00
commit 26bff69cb5
2 changed files with 10 additions and 4 deletions

View File

@ -435,8 +435,11 @@ class Server(object):
if not conf_files:
# maybe there's a config file(s) out there, but I couldn't find it!
if not kwargs.get('quiet'):
print _('Unable to locate config %sfor %s') % (
('number %s ' % number if number else ''), self.server)
if number:
print _('Unable to locate config number %s for %s' % (
number, self.server))
else:
print _('Unable to locate config for %s' % (self.server))
if kwargs.get('verbose') and not kwargs.get('quiet'):
if found_conf_files:
print _('Found configs:')

View File

@ -445,7 +445,8 @@ class TestServer(unittest.TestCase):
# check warn "unable to locate"
conf_files = server.conf_files()
self.assertFalse(conf_files)
self.assert_('unable to locate' in pop_stream(f).lower())
self.assert_('unable to locate config for auth'
in pop_stream(f).lower())
# check quiet will silence warning
conf_files = server.conf_files(verbose=True, quiet=True)
self.assertEquals(pop_stream(f), '')
@ -455,7 +456,9 @@ class TestServer(unittest.TestCase):
self.assertEquals(pop_stream(f), '')
# check missing config number warn "unable to locate"
conf_files = server.conf_files(number=2)
self.assert_('unable to locate' in pop_stream(f).lower())
self.assert_(
'unable to locate config number 2 for ' +
'container-auditor' in pop_stream(f).lower())
# check verbose lists configs
conf_files = server.conf_files(number=2, verbose=True)
c1 = self.join_swift_dir('container-server/1.conf')