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

[Suggestion] Should we setup locales using the LANG/LC_* env? #571

Closed
black-desk opened this issue Dec 27, 2022 · 6 comments
Closed

[Suggestion] Should we setup locales using the LANG/LC_* env? #571

black-desk opened this issue Dec 27, 2022 · 6 comments
Labels
enhancement New feature or request

Comments

@black-desk
Copy link
Contributor

black-desk commented Dec 27, 2022

Is your feature request related to a problem? Please describe.

When I enter the container, I found that inside container I have empty LANG, and empty /etc/locale.gen, which means application will fallback to LANG=C or something like that.

Describe the solution you'd like

Should we just automatically setup language/encoding when we create the container? such like install "locales" and run dpkg reconfigure locales according to the environment var like LANG/LC_*

@black-desk black-desk added the enhancement New feature or request label Dec 27, 2022
@black-desk black-desk changed the title [Suggestion] Should we just setup locale using the LANG/LA env [Suggestion] Should we just setup locale using the LANG/LC_xxx env? Dec 27, 2022
@black-desk black-desk changed the title [Suggestion] Should we just setup locale using the LANG/LC_xxx env? [Suggestion] Should we just setup locale using the LANG/LC_* env? Dec 27, 2022
@black-desk black-desk changed the title [Suggestion] Should we just setup locale using the LANG/LC_* env? [Suggestion] Should we setup locale using the LANG/LC_* env? Dec 27, 2022
@black-desk black-desk changed the title [Suggestion] Should we setup locale using the LANG/LC_* env? [Suggestion] Should we setup locales using the LANG/LC_* env? Dec 27, 2022
@juhp
Copy link
Contributor

juhp commented Dec 27, 2022

This OS specific I think: eg fedora base containers default to LANG=C.UTF-8

@black-desk
Copy link
Contributor Author

But should we keep LANG sync with host? It seems not very hard to do that. Just install some package include /usr/share/locales/i18n/... and a localedef command will get this job done.

For now, the enter command will ignore LANG, which make everything in container fallback to English.

@juhp
Copy link
Contributor

juhp commented Dec 28, 2022

Sure it is makes sense to do something for debian/ubuntu here.
Some locale package could indeed be added in distrobox-init for deb based containers with POSIX locale.

@89luca89
Copy link
Owner

Intresting, mounting /usr/share/locales could be a neat addition to the integration, this needs more tests and investigations 😄

@black-desk
Copy link
Contributor Author

Intresting, mounting /usr/share/locales could be a neat addition to the integration, this needs more tests and investigations smile

I don't think that would work, as the libc in container might be different from that in host.

@89luca89
Copy link
Owner

89luca89 commented Aug 4, 2023

now init will setting up at least en_US.UTF-8 by default
At least this way it does not revert to C.POSIX which would let to errors

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

No branches or pull requests

3 participants