Clean up VLang by using "value" on language select

This commit is contained in:
Neil Williams
2011-08-24 11:08:44 -07:00
parent 29fd956673
commit 87a45f8bce
2 changed files with 3 additions and 6 deletions

View File

@@ -223,11 +223,8 @@ class nop(Validator):
class VLang(Validator):
def run(self, lang):
if lang:
lang = str(lang.split('[')[1].strip(']'))
if lang in g.all_languages:
return lang
#else
if lang in g.all_languages:
return lang
return g.lang
class VRequired(Validator):

View File

@@ -201,7 +201,7 @@ ${unsafe(txt)}
</option>
%endif
%for x in langs:
<option ${x == default_lang and "selected='selected'" or ""}>
<option ${x == default_lang and "selected='selected'" or ""} value="${x}">
${g.lang_name[x]} [${x}]
</option>
%endfor