mirror of https://github.com/Mikaela/Limnoria.git
Google: Fix Language.normalize to not prepend the empty string with 'lang_'
This commit is contained in:
parent
10342acd11
commit
125d542706
|
@ -54,7 +54,7 @@ class Language(registry.OnlySomeStrings):
|
||||||
'tr'.split()]
|
'tr'.split()]
|
||||||
validStrings.append('')
|
validStrings.append('')
|
||||||
def normalize(self, s):
|
def normalize(self, s):
|
||||||
if not s.startswith('lang_'):
|
if s and not s.startswith('lang_'):
|
||||||
s = 'lang_' + s
|
s = 'lang_' + s
|
||||||
if not s.endswith('CN') or s.endswith('TW'):
|
if not s.endswith('CN') or s.endswith('TW'):
|
||||||
s = s.lower()
|
s = s.lower()
|
||||||
|
|
Loading…
Reference in New Issue