Merge pull request #1989 from radfish/PR-py3--translate-bytearray-fix
Ui, Translate: fix bytearray format string for Py 3.4
This commit is contained in:
commit
dd4c213805
2 changed files with 2 additions and 2 deletions
|
@ -57,7 +57,7 @@ class UiRequestPlugin(object):
|
||||||
if not lang_file_exist or inner_path not in content_json.get("translate", []):
|
if not lang_file_exist or inner_path not in content_json.get("translate", []):
|
||||||
for part in file_generator:
|
for part in file_generator:
|
||||||
if inner_path.endswith(".html"):
|
if inner_path.endswith(".html"):
|
||||||
yield part.replace(b"lang={lang}", b"lang=%s" % translate.lang.encode("utf8")) # lang get parameter to .js file to avoid cache
|
yield part.replace(b"lang={lang}", b"lang=" + translate.lang.encode("utf8")) # lang get parameter to .js file to avoid cache
|
||||||
else:
|
else:
|
||||||
yield part
|
yield part
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -299,7 +299,7 @@ class UiRequest(object):
|
||||||
# Redirect to an url
|
# Redirect to an url
|
||||||
def actionRedirect(self, url):
|
def actionRedirect(self, url):
|
||||||
self.start_response('301 Redirect', [('Location', str(url))])
|
self.start_response('301 Redirect', [('Location', str(url))])
|
||||||
yield b"Location changed: %s" % url.encode("utf8")
|
yield b"Location changed: " + url.encode("utf8")
|
||||||
|
|
||||||
def actionIndex(self):
|
def actionIndex(self):
|
||||||
return self.actionRedirect("/" + config.homepage)
|
return self.actionRedirect("/" + config.homepage)
|
||||||
|
|
Loading…
Reference in a new issue