Correct parsing of defaultLanguage parameter.

This commit is contained in:
James Vega 2008-08-16 00:13:20 +00:00
parent 62a8306fbb
commit 1fbf61c571
1 changed files with 4 additions and 1 deletions

View File

@ -56,7 +56,10 @@ class Language(registry.OnlySomeStrings):
def normalize(self, s):
if not s.startswith('lang_'):
s = 'lang_' + s
s = s[:-2].lower() + s[-2:]
if not s.endswith('CN') or s.endswith('TW'):
s = s.lower()
else:
s = s.lower()[:-2] + s[-2:]
return s
class NumSearchResults(registry.PositiveInteger):