Remove unnecessary unicode prefixes

Change-Id: Ia75cc0c9fd5117b22b54fe872b28a4164faedf9a
This commit is contained in:
songwenping 2022-04-19 19:30:47 +08:00
parent f718684d59
commit 342d388803
6 changed files with 15 additions and 15 deletions

View File

@ -33,8 +33,8 @@ openstackdocs_bug_tag = ''
master_doc = 'index'
# General information about the project.
project = u'oslo.i18n'
copyright = u'2014, OpenStack Foundation'
project = 'oslo.i18n'
copyright = '2014, OpenStack Foundation'
# If true, '()' will be appended to :func: etc. cross-reference text.
add_function_parentheses = True

View File

@ -168,8 +168,8 @@ class Message(str):
# Do not translate this log message even if it is used as a
# warning message as a wrong translation of this message could
# cause infinite recursion
msg = (u'Failed to insert replacement values into translated '
u'message %s (Original: %r): %s')
msg = ('Failed to insert replacement values into translated '
'message %s (Original: %r): %s')
warnings.warn(msg % (translated_message, self.msgid, err))
LOG.debug(msg, translated_message, self.msgid, err)

View File

@ -38,7 +38,7 @@ class TranslationFixtureTest(test_base.BaseTestCase):
msg = self.trans_fixture.immediate('this is a lazy message')
self.assertNotIsInstance(msg, _message.Message)
self.assertIsInstance(msg, str)
self.assertEqual(u'this is a lazy message', msg)
self.assertEqual('this is a lazy message', msg)
class ToggleLazyFixtureText(test_base.BaseTestCase):

View File

@ -166,7 +166,7 @@ class MessageTestCase(test_base.BaseTestCase):
result = _message.Message(msgid) % params
# Now set up ugettext to return the translated version of
# the original message, with a bad format string.
wrong_type = u'Wrong type %(arg1)d'
wrong_type = 'Wrong type %(arg1)d'
trans.return_value.gettext.return_value = wrong_type
trans_result = result.translation()
expected = msgid % params

View File

@ -37,4 +37,4 @@ class PublicAPITest(unittest.TestCase):
oslo_i18n.enable_lazy(original)
def test_translate(self):
oslo_i18n.translate(u'string')
oslo_i18n.translate('string')

View File

@ -58,8 +58,8 @@ source_suffix = '.rst'
master_doc = 'index'
# General information about the project.
project = u'oslo.i18n Release Notes'
copyright = u'2016, oslo.i18n Developers'
project = 'oslo.i18n Release Notes'
copyright = '2016, oslo.i18n Developers'
# Release notes do not need a version in the title, they span
# multiple versions.
@ -210,8 +210,8 @@ latex_elements = {
# author, documentclass [howto, manual, or own class]).
latex_documents = [
('index', 'oslo.i18nReleaseNotes.tex',
u'oslo.i18n Release Notes Documentation',
u'oslo.i18n Developers', 'manual'),
'oslo.i18n Release Notes Documentation',
'oslo.i18n Developers', 'manual'),
]
# The name of an image file (relative to this directory) to place at the top of
@ -241,8 +241,8 @@ latex_documents = [
# (source start file, name, description, authors, manual section).
man_pages = [
('index', 'oslo.i18nReleaseNotes',
u'oslo.i18n Release Notes Documentation',
[u'oslo.i18n Developers'], 1)
'oslo.i18n Release Notes Documentation',
['oslo.i18n Developers'], 1)
]
# If true, show URL addresses after external links.
@ -256,8 +256,8 @@ man_pages = [
# dir menu entry, description, category)
texinfo_documents = [
('index', 'oslo.i18nReleaseNotes',
u'oslo.i18n Release Notes Documentation',
u'oslo.i18n Developers', 'oslo.i18nReleaseNotes',
'oslo.i18n Release Notes Documentation',
'oslo.i18n Developers', 'oslo.i18nReleaseNotes',
'One line description of project.',
'Miscellaneous'),
]