I think you can try to import the locale
library first:
import locale
locale.setlocale(category=locale.LC_ALL,
locale="German" # Note: do not use "de_DE" as it doesn't work)
In your case, you would replace German
by Spanish
You also might have some luck with:
try:
import locale
locale.setlocale(locale.LC_ALL, 'en_US.utf8')
except Exception:
try:
locale.setlocale(locale.LC_ALL, 'en_US.UTF-8')
except Exception as e:
messages.error(request, 'An error occurred: {0}'.format(e))
It is also possible to set LC_ALL in your environment by running the following command:
$ export LC_ALL=C
If that doesn't help, then you can try to install dpkg using sudo port install dpkg
or brew
(http://macappstore.org/dpkg/)
And then the following:
export LC_ALL="en_US.UTF-8"
export LC_CTYPE="en_US.UTF-8"
sudo dpkg-reconfigure locales
For your case, I believe the locale would be 'es_ES.UTF-8'
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…