Open sultaniman opened 11 years ago
>>> import itertools, locale
>>> list(itertools.ifilter(lambda l: l == 'en' or l == 'ru', locale.locale_alias.keys()))
['en', 'ru']
>>> list(itertools.ifilter(lambda l: l.startswith('en') or l.startswith('ru'), locale.locale_alias.keys()))
[
'english_united-states', 'en_gb@euro', 'english_us.ascii', 'ru_ua.koi8u',
'ru_ua.microsoftcp1251', 'rumanian', 'ru.koi8r', 'en_au', 'en_za.iso88591',
'en_hk', 'en_us.885915', 'en_us.iso885915@euro', 'en_sg', 'en_za', 'en_zw',
'en_us@euro', 'en_sg.iso88591', 'en_ie', 'en_in', 'ru_ru.koi8r', 'en_ie@euro',
'en_be', 'en_bw', 'en_uk', 'en_us', 'en_us@euro@euro', 'ru_ru.cp1251',
'en_gb.iso885915', 'eng_gb', 'en_ca', 'en_za@euro', 'russian', 'english_us.8859',
'en_hk.iso88591', 'en_gb.88591', 'en_ie.utf8@euro', 'ru_ua.cp1251', 'en_za.iso885915',
'eng_gb.8859', 'en_us.iso88591', 'en.iso88591', 'en', 'english.iso88591', 'en_ph.iso88591',
'en_ph', 'en_nz.iso88591', 'english_uk', 'english_us', 'en_ca.iso88591', 'ru_ru.microsoftcp1251',
'en_us.iso885915', 'en_za.88591', 'english_uk.8859', 'en_ie.iso88591', 'english_united-states.437',
'en_us.88591', 'en_zw.iso88591', 'en_gb.iso88591', 'en_ie.iso885915', 'en_gb', 'en_nz', 'english',
'en_bw.iso88591', 'ru_ru', 'ru_ua', 'ru_ru.iso88595', 'en_ie.iso885915@euro', 'en_au.iso88591',
'en_be@euro', 'ru']
What do you get?
If you are on ubuntu, you can also try:
apt-get install locales-all
Anyways, I suspect the problem is you don't have en
or ru
or both unavailable as independent locales. So one option is for you to change en
and ru
to en_us
and ru_ru
everywhere.
I have the same output, I work on OSX here is my ~/.profile file
export LANG="ru_RU.UTF-8"
export LC_COLLATE="ru_RU.UTF-8"
export LC_CTYPE="ru_RU.UTF-8"
export LC_MESSAGES="ru_RU.UTF-8"
export LC_MONETARY="ru_RU.UTF-8"
export LC_NUMERIC="ru_RU.UTF-8"
export LC_TIME="ru_RU.UTF-8"
export LC_ALL=
I get the same error even if change ru to ru_ru and en to en_us in language and locale settings in *.yaml files
The same thing, for a while I decided to stay with old configs to provide basic internationalization
So, after you changed export LC_ALL=
to export LC_ALL='en_US'
and sourced the profile you still get the same error?
I meant export LC_ALL='ru_RU'
Yes I've the same error, though I've a lot of other Django projects and they work just fine.
hmm. I am really not sure what the issue is then.
(M=3f8fe) [trans] lakshmivyas@AIR-LAKSHMI.LOCAL ~/work/hyde/source/trans> locale >> o
(M=3f8fe o) [trans] lakshmivyas@AIR-LAKSHMI.LOCAL ~/work/hyde/source/trans> hyde gen -r >> o
(M=3f8fe o) [trans] lakshmivyas@AIR-LAKSHMI.LOCAL ~/work/hyde/source/trans> lssitepackages >> o
(M=3f8fe o) [trans] lakshmivyas@AIR-LAKSHMI.LOCAL ~/work/hyde/source/trans> cat o
LANG="ru_RU.UTF-8"
LC_COLLATE="ru_RU.UTF-8"
LC_CTYPE="ru_RU.UTF-8"
LC_MESSAGES="ru_RU.UTF-8"
LC_MONETARY="ru_RU.UTF-8"
LC_NUMERIC="ru_RU.UTF-8"
LC_TIME="ru_RU.UTF-8"
LC_ALL="ru_RU.UTF-8"
14:47:59 hyde.engine Reading site configuration from [/Users/lakshmivyas/work/hyde/source/trans/site.yaml]
14:47:59 hyde Regenerating the site...
14:47:59 hyde.engine Reading site contents
14:47:59 hyde.engine Generating site at [/Users/lakshmivyas/work/hyde/source/trans]
14:47:59 hyde.engine Configuring the template environment
14:47:59 hyde.engine Generating site to [/Users/lakshmivyas/work/hyde/source/trans/deploy]
14:48:01 hyde Generation complete.
Babel-0.9.6-py2.7.egg-info
Jinja2-2.6-py2.7.egg-info
Markdown-2.2.0-py2.7.egg-info
Markdown.egg-link
PyYAML-3.10-py2.7.egg-info
Pygments-1.5-py2.7.egg-info
argparse-1.2.1-py2.7.egg-info
argparse.py
argparse.pyc
babel
commando-0.1.2a-py2.7.egg-info
commando.py
commando.pyc
cssselect
cssselect-0.7.1-py2.7.egg-info
distribute-0.6.14-py2.7.egg
easy-install.pth
hyde.egg-link
jinja2
lxml
lxml-3.0.1-py2.7.egg-info
markdown
pip-1.2.1-py2.7.egg
pygments
pyquery
pyquery-1.2.1-py2.7.egg-info
setuptools-0.6c11-py2.7.egg
setuptools.pth
smartypants-1.6.0.3-py2.7.egg-info
smartypants.py
smartypants.pyc
typogrify-hyde.egg-link
On ubuntu 12.04, I needed to apt get install language-pack-ru
and then it worked fine.
what does locale -a |grep ru
in an OS X terminal show?
Playing in a python shell, it seems using a tuple for 2nd arg to setlocale breaks on OS X (10.6.8) system python (2.6.1). Calling locale.setlocale(locale.LC_ALL, 'ru_RU.UTF-8')
works correctly (on linux too).
I've fixed this error here is the fixes, just added some conditional statements
def begin_text_resource(self, resource, text):
try:
lc = resource.meta.lc
self.default_locale = locale.getlocale()
if 'darwin' in sys.platform:
locale.setlocale(locale.LC_ALL, lc)
elif 'linux' in sys.platform:
locale.setlocale(locale.LC_ALL, (lc, resource.meta.encoding))
self.template.env.install_gettext_translations(self.translations[lc], newstyle=True)
except AttributeError:
pass
return text
And now I have the error like
Traceback (most recent call last):
File "/Users/sultan/.virtualenvs/e/bin/hyde", line 8, in <module>
load_entry_point('hyde==0.8.5a15', 'console_scripts', 'hyde')()
File "/Users/sultan/.virtualenvs/e/src/hyde/hyde/main.py", line 10, in main
Engine().run()
File "/Users/sultan/.virtualenvs/e/src/hyde/hyde/engine.py", line 39, in run
super(Engine, self).run(args)
File "/Users/sultan/.virtualenvs/e/lib/python2.7/site-packages/commando.py", line 198, in run
args.run(self, args)
File "/Users/sultan/.virtualenvs/e/src/hyde/hyde/engine.py", line 118, in gen
gen.generate_all(incremental=incremental)
File "/Users/sultan/.virtualenvs/e/src/hyde/hyde/generator.py", line 205, in generate_all
self.__generate_node__(self.site.content, incremental)
File "/Users/sultan/.virtualenvs/e/src/hyde/hyde/generator.py", line 303, in __generate_node__
self.__generate_resource__(resource, incremental)
File "/Users/sultan/.virtualenvs/e/src/hyde/hyde/generator.py", line 324, in __generate_resource__
self.update_deps(resource)
File "/Users/sultan/.virtualenvs/e/src/hyde/hyde/generator.py", line 148, in update_deps
self.deps[rel_path] = deps
File "/Users/sultan/.virtualenvs/e/bin/../lib/python2.7/UserDict.py", line 24, in __setitem__
def __setitem__(self, key, item): self.data[key] = item
TypeError: 'NoneType' object does not support item assignment