mirror of https://github.com/zulip/zulip.git
zerver/management: Remove u prefix from strings.
License: Apache-2.0 Signed-off-by: rht <rhtbot@protonmail.com>
This commit is contained in:
parent
dc37e3f72c
commit
839b427ea5
|
@ -81,8 +81,8 @@ class Command(compilemessages.Command):
|
|||
return locales
|
||||
|
||||
def extract_language_options(self) -> None:
|
||||
locale_path = u"{}/locale".format(settings.STATIC_ROOT)
|
||||
output_path = u"{}/language_options.json".format(locale_path)
|
||||
locale_path = "{}/locale".format(settings.STATIC_ROOT)
|
||||
output_path = "{}/language_options.json".format(locale_path)
|
||||
|
||||
data = {'languages': []} # type: Dict[str, List[Dict[str, Any]]]
|
||||
|
||||
|
@ -92,7 +92,7 @@ class Command(compilemessages.Command):
|
|||
# In case we are not under a Git repo, fallback to getting the
|
||||
# locales using listdir().
|
||||
locales = os.listdir(locale_path)
|
||||
locales.append(u'en')
|
||||
locales.append('en')
|
||||
locales = list(set(locales))
|
||||
|
||||
for locale in locales:
|
||||
|
|
|
@ -46,8 +46,8 @@ from django.utils.translation import template
|
|||
|
||||
from zerver.lib.str_utils import force_text
|
||||
|
||||
strip_whitespace_right = re.compile(u"(%s-?\\s*(trans|pluralize).*?-%s)\\s+" % (BLOCK_TAG_START, BLOCK_TAG_END), re.U)
|
||||
strip_whitespace_left = re.compile(u"\\s+(%s-\\s*(endtrans|pluralize).*?-?%s)" % (
|
||||
strip_whitespace_right = re.compile("(%s-?\\s*(trans|pluralize).*?-%s)\\s+" % (BLOCK_TAG_START, BLOCK_TAG_END), re.U)
|
||||
strip_whitespace_left = re.compile("\\s+(%s-\\s*(endtrans|pluralize).*?-?%s)" % (
|
||||
BLOCK_TAG_START, BLOCK_TAG_END), re.U)
|
||||
|
||||
regexes = ['{{#tr .*?}}([\s\S]*?){{/tr}}', # '.' doesn't match '\n' by default
|
||||
|
@ -64,8 +64,8 @@ multiline_js_comment = re.compile("/\*.*?\*/", re.DOTALL)
|
|||
singleline_js_comment = re.compile("//.*?\n")
|
||||
|
||||
def strip_whitespaces(src: Text) -> Text:
|
||||
src = strip_whitespace_left.sub(u'\\1', src)
|
||||
src = strip_whitespace_right.sub(u'\\1', src)
|
||||
src = strip_whitespace_left.sub('\\1', src)
|
||||
src = strip_whitespace_right.sub('\\1', src)
|
||||
return src
|
||||
|
||||
class Command(makemessages.Command):
|
||||
|
|
Loading…
Reference in New Issue