Subversion Repositories navi

Compare Revisions

Regard whitespace Rev 151 → Rev 152

/webapp/main.py
60,7 → 60,7
 
class Translate(tornado.web.RequestHandler):
def get(self):
self.render("templates/translate.html", last="", out=None)
self.render("templates/translate.html", last="", out=None, lang="eng")
def post(self):
try:
69,7 → 69,7
except:
self.redirect("/translate")
out = translate.translatesent(word, lang)
self.render("templates/translate.html", last=word, out=out)
self.render("templates/translate.html", last=word, out=out, lang=lang)
 
settings = {
"static_path": os.path.join(os.path.dirname(__file__), "static")
/webapp/templates/translate.html
7,11 → 7,11
<form action="/translate" method="post">
<input id="word" name="word" type="text" value="{{last}}" style="width: 100%;" />
<select name="lang">
<option value="eng" selected="">English</option>
<option value="hu">Hungarian - Magyar</option>
<option value="de">German - Deutsch</option>
<option value="est">Estonian - Eesti</option>
<option value="ptbr">Brazilian Portuguese - Português do Brasil</option>
<option id="eng" value="eng" selected="selected">English</option>
<option id="hu" value="hu">Hungarian - Magyar</option>
<option id="de" value="de">German - Deutsch</option>
<option id="est" value="est">Estonian - Eesti</option>
<option id="ptbr" value="ptbr">Brazilian Portuguese - Português do Brasil</option>
</select>
<input name="btn" type="submit" value="Parse!" />
</form>
49,4 → 49,9
<script type="text/javascript">
document.getElementById("word").focus();
</script>
{% if lang != "eng" %}
<script type="text/javascript">
document.getElementById(lang).selected = "selected"
</script>
{% end %}
{% end %}