[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[or-cvs] r14464: Added some extra locale debugging information, change of lan (check/trunk/cgi-bin)
Author: ioerror
Date: 2008-04-25 04:51:31 -0400 (Fri, 25 Apr 2008)
New Revision: 14464
Modified:
check/trunk/cgi-bin/index.py
Log:
Added some extra locale debugging information, change of language, more attempts to force a specific locale despite apache not wanting to.
Modified: check/trunk/cgi-bin/index.py
===================================================================
--- check/trunk/cgi-bin/index.py 2008-04-25 07:43:36 UTC (rev 14463)
+++ check/trunk/cgi-bin/index.py 2008-04-25 08:51:31 UTC (rev 14464)
@@ -11,6 +11,7 @@
# Best used with the Debian packages:
# python-dns
# libapache2-mod-python
+# locales-all
#
# * Copyright (c) 2008, Jacob Appelbaum *
# * See LICENSE for licensing information *
@@ -25,6 +26,7 @@
from mod_python import util
import cgitb; cgitb.enable()
import gettext
+import locale
# We could also explictly query the remote EL server
# This is not as good as using a cache for obvious reasons
@@ -89,7 +91,7 @@
default_locale = "en_US"
locale = default_locale
- locales = ( default_locale, 'fa-IR')
+ 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))
@@ -113,10 +115,8 @@
req.write("We have selected the locale of: %s \n<br>\n" % locale)
# i18n with Unicode!
- # We need to make some TorCheck.{po,pot,mo} files
- gettext.install('TorCheck','.', unicode=1)
- gettext.bind_textdomain_codeset('TorCheck', locale)
- _ = gettext.gettext
+ # Ensure you have properly installed TorCheck.{po,pot,mo} files
+ gettext.install('TorCheck','/usr/share/locale', unicode=1)
# Now that we know everything we need, lets print the website
def handler(req):
@@ -134,6 +134,7 @@
# 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)
@@ -182,7 +183,7 @@
req.write('<p><tt>')
req.write(_('Additional information: '))
req.write('<br>\n')
- req.write(_('Your IP appears to be: '))
+ req.write(_('Your IP address appears to be: '))
req.write('<b>%s</b><br>\n' % req.connection.remote_ip )
req.write(_('This small script is powered by <a href="http://exitlist.torproject.org/">tordnsel</a>'))
req.write('<br><br>')