-
Notifications
You must be signed in to change notification settings - Fork 2k
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
How do I install additional locales/languages? #1041
Comments
I don't see any way to tag this as a question instead of an issue. Sorry. |
From #359 (comment) the default $ docker run -it -e LC_ALL=C.UTF-8 -e LANG="de_DE@euro"--rm php bash
root@48fd94f8dfbc:/# mkdir Übersetzen
root@48fd94f8dfbc:/# touch Übersetzen/Grüße_Welt
root@48fd94f8dfbc:/# ls Übersetzen
Grüße_Welt |
Thanks, but I need to install language packs for PHP so that it properly supports spitting out "0,75" (COMMA) instead of "0.75" (DOT) when I "echo 3/4". UTF8 characters haven't been a problem so far... Or is this just how PHP works? US locale settings only? What is setlocale() for then? Should I use something else than docker/php for international websites? |
PHP probably just uses what libc provides. So, most likely you would need to install |
Neither locale.gen nor /etc/locale.gen are available in docker/php and I think that's because it is based on Alpine Linux and not Arch Linux. I feel like I'm doing something massively wrong because I can't comprehend why it is so damn hard to get additional languages to work. |
Alpine doesn't really have support for locales (gliderlabs/docker-alpine#144). There are users in that thread and here that are adding some locales to Alpine, but I'm not certain that their methods will work in the future. Alternatively you could just use the non-alpine images that are Debian based and just |
Okay, I'll try to find a php-fpm debian docker that runs on a Raspberry Pi. :( Again though, am I using something wrong here? It feels like a massive oversight that docker/php with multiple millions of downloads isn't supporting locales. |
If you read the comment again it's just that alpine doesn't support locales. This set of images has the Debian version as the default for these kind of customization reasons. |
Okay, I don't know what I did wrong until now, but I was under the impression that all docker/php images were alpine. Thank you for helping me out. I probably pulled the wrong images by accident. |
Closing since this seems resolved |
locale -a only has
C
C.UTF-8
POSIX
and I need something like de-DE to get proper formatting for my php website.
Or am I doing something wrong? I'm using setlocale(LC_ALL, 'de_DE@euro', 'de_DE', 'deu_deu') but no matter what it returns, the language settings won't change.
The text was updated successfully, but these errors were encountered: