Merge pull request #532 from splav/master
to_unicode fix in locale.load_translations
This commit is contained in:
commit
a303c01acf
|
@ -47,6 +47,8 @@ import logging
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
|
|
||||||
|
from tornado import escape
|
||||||
|
|
||||||
_default_locale = "en_US"
|
_default_locale = "en_US"
|
||||||
_translations = {}
|
_translations = {}
|
||||||
_supported_locales = frozenset([_default_locale])
|
_supported_locales = frozenset([_default_locale])
|
||||||
|
@ -124,7 +126,7 @@ def load_translations(directory):
|
||||||
for i, row in enumerate(csv.reader(f)):
|
for i, row in enumerate(csv.reader(f)):
|
||||||
if not row or len(row) < 2:
|
if not row or len(row) < 2:
|
||||||
continue
|
continue
|
||||||
row = [c.decode("utf-8").strip() for c in row]
|
row = [escape.to_unicode(c).strip() for c in row]
|
||||||
english, translation = row[:2]
|
english, translation = row[:2]
|
||||||
if len(row) > 2:
|
if len(row) > 2:
|
||||||
plural = row[2] or "unknown"
|
plural = row[2] or "unknown"
|
||||||
|
|
Loading…
Reference in New Issue