Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to install zh_CN locale #12

Closed
craiga opened this issue Oct 16, 2018 · 4 comments
Closed

Unable to install zh_CN locale #12

craiga opened this issue Oct 16, 2018 · 4 comments

Comments

@craiga
Copy link

craiga commented Oct 16, 2018

In .locale, I have the zh_CN for Chinese support, but language-pack-zh-base isn't a package. Does there need to be special handling for Chinese locales?

=== Updating or installing language-pack-zh-base
Hit:1 http://archive.ubuntu.com/ubuntu xenial InRelease
Hit:2 http://apt.postgresql.org/pub/repos/apt xenial-pgdg InRelease
Hit:3 http://archive.ubuntu.com/ubuntu xenial-security InRelease
Hit:4 http://archive.ubuntu.com/ubuntu xenial-updates InRelease
Reading package lists...
Reading package lists...
Building dependency tree...
Package language-pack-zh-base is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
  language-pack-zh-hant-base language-pack-zh-hans-base
E: Package 'language-pack-zh-base' has no installation candidate
 !     Push rejected, failed to compile Locale app.
 !     Push failed
@dmathieu
Copy link
Contributor

Could you try putting the following in .locales:

zh-ant_CN

@craiga
Copy link
Author

craiga commented Oct 16, 2018

Cool, the following both worked:

zh-hans_CN
zh-hant_CN

These aren't "proper" locale codes though, are they?

I'd be willing to try and contribute a patch to fix this, but I'm no expert in how Chinese locales should be handled.

@dmathieu
Copy link
Contributor

I think this is fine. You can set a proper LOCALE environment variable to use the right one.

@craiga
Copy link
Author

craiga commented Oct 17, 2018

Hmm, I'm not sure if this is working. I can't set a Chinese locale in bash or Python.

$ heroku run bash --app unixtimesta-mp
Running bash on ⬢ unixtimesta-mp... up, run.8744 (Hobby)
[error] cannot open locale definition file `zh-hans_CN': No such file or directory
[error] cannot open locale definition file `zh-hant_CN': No such file or directory
~ $ export LC_ALL=fr_CA
~ $ date
mercredi 17 octobre 2018, 08:57:51 (UTC+0000)
~ $ export LC_ALL=zh
bash: warning: setlocale: LC_ALL: cannot change locale (zh)
~ $ export LC_ALL=zh_hans
bash: warning: setlocale: LC_ALL: cannot change locale (zh_hans): No such file or directory
~ $ export LC_ALL=zh-hans
bash: warning: setlocale: LC_ALL: cannot change locale (zh-hans): No such file or directory
~ $ export LC_ALL=zh-hans_CN
bash: warning: setlocale: LC_ALL: cannot change locale (zh-hans_CN): No such file or directory
~ $ python
Python 3.7.0 (default, Aug  1 2018, 21:18:01) 
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import locale
>>> locale.setlocale(locale.LC_ALL, ('fr_CA', 'UTF-8'))
'fr_CA.UTF-8'
>>> locale.setlocale(locale.LC_ALL, ('zh_CN', 'UTF-8'))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/app/.heroku/python/lib/python3.7/locale.py", line 604, in setlocale
    return _setlocale(category, locale)
locale.Error: unsupported locale setting

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants