如何将“locale”设置为加泰罗尼亚语?

时间:2017-07-04 09:03:49

标签: python python-2.7 locale setlocale

我想更改locale的设置,以便在加泰罗尼亚语中显示标题。为此,我从终端执行了这个命令:

sudo ln -s /usr/share/i18n/SUPPORTED /var/lib/locales/supported.d/all
sudo locale-gen

在Jupyter Notebook中我有这段代码:

import locale
locale.setlocale(locale.LC_ALL, 'ca_ES.UTF-8')

这是错误消息:

---------------------------------------------------------------------------
Error                                     Traceback (most recent call last)
<ipython-input-30-4d0596ce2d84> in <module>()
     11 # sudo ln -s /usr/share/i18n/SUPPORTED /var/lib/locales/supported.d/all
     12 # sudo locale-gen
---> 13 locale.setlocale(locale.LC_ALL, 'ca_ES.UTF-8')
     14 
     15 get_ipython().magic(u'matplotlib inline')

/home/ddd/anaconda2/lib/python2.7/locale.pyc in setlocale(category, locale)
    579         # convert to string
    580         locale = normalize(_build_localename(locale))
--> 581     return _setlocale(category, locale)
    582 
    583 def resetlocale(category=LC_ALL):

Error: unsupported locale setting

0 个答案:

没有答案