[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[or-cvs] r14465: Removal of debugging information. Automatic translation now (check/trunk/cgi-bin)
Author: ioerror
Date: 2008-04-25 05:13:33 -0400 (Fri, 25 Apr 2008)
New Revision: 14465
Modified:
check/trunk/cgi-bin/index.py
Log:
Removal of debugging information. Automatic translation now works when we pass in supported language values.
Modified: check/trunk/cgi-bin/index.py
===================================================================
--- check/trunk/cgi-bin/index.py 2008-04-25 08:51:31 UTC (rev 14464)
+++ check/trunk/cgi-bin/index.py 2008-04-25 09:13:33 UTC (rev 14465)
@@ -93,30 +93,14 @@
locale = default_locale
locales = ( default_locale, 'fa-IR', 'es')
- # TODO: Remove all of this debug information when we know this works properly
- req.write("We have %i possible locales.\n<br>\n" % len(locales))
- req.write("Our internal and supported locales are: ")
for item in locales:
- req.write(item + " ")
- req.write("<br>")
-
- if user_supplied_lang :
- req.write("You have selected the locale of: %s\n<br>\n" % user_supplied_lang)
- else:
- req.write("You have not selected a locale\n<br>\n")
-
- for item in locales:
if item == user_supplied_lang:
locale = item
- req.write("We have selected the locale of: %s\n<br>\n" % locale)
- break
- if locale != user_supplied_lang:
- req.write("We have selected the locale of: %s \n<br>\n" % locale)
-
# i18n with Unicode!
# Ensure you have properly installed TorCheck.{po,pot,mo} files
- gettext.install('TorCheck','/usr/share/locale', unicode=1)
+ lang = gettext.translation('TorCheck', languages=[locale])
+ lang.install()
# Now that we know everything we need, lets print the website
def handler(req):
@@ -131,15 +115,8 @@
req.write('<html>\n')
req.write('<body>\n')
- # TODO: Remove this
- req.write('Debug info: <br>')
- req.write('UsingTor is set to: %s<br>' % UsingTor )
- req.write('We\'re using the locale of: ' + locale.getdefaultlocale()[1] + '\n<br><br>')
-
parseLang(req)
- req.write("\n<br><br>\n")
-
req.write('<title>Are you using Tor?</title>\n')
req.write('<center>\n')