Google: Fix Language.normalize to not prepend the empty string with 'lang_'

This commit is contained in:
James Vega 2009-01-28 21:22:34 +00:00
parent 10342acd11
commit 125d542706
1 changed files with 1 additions and 1 deletions

View File

@ -54,7 +54,7 @@ class Language(registry.OnlySomeStrings):
'tr'.split()]
validStrings.append('')
def normalize(self, s):
if not s.startswith('lang_'):
if s and not s.startswith('lang_'):
s = 'lang_' + s
if not s.endswith('CN') or s.endswith('TW'):
s = s.lower()