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
Install system locales in web image #822
Comments
Thanks for this request! What's required to install the locales is For people who need this immediately, it can be done in any container with
This is lost on a |
+1 we should have and option in ddev-config to set the local. Because we need correct date settings in php. |
@dahaupt @sbaghdadi I'd love it if you could test #1106, there are testing instructions there. |
What happened (or feature request):
I was using the method
strftime('%B', mktime(0, 0, 0, 1, 1))
in PHP to format a date (here to get the month name), but unfortunately the month was not localized to German but English only, no matter if I changed the default locale in PHP withsetlocale(LC_TIME, "de_DE")
before.What the method does:
strftime
— Format a local time/date according to locale settingsWhat you expected to happen:
The method
strftime
should be able to use the systems locale to format any date correctly.How to reproduce this:
Execute this snippet in any DDEV environment:
Version: Please include the output of
ddev version
,docker version
and the project's .ddev/config.yaml.Anything else do we need to know:
The problem is based on the fact that no locales are installed in the web container except:
My workaround was to use http://php.net/manual/en/class.intldateformatter.php to format the month name which works great without having any locale installed in the web container.
Related source links or issues:
http://php.net/manual/en/function.strftime.php
Please use a complexity rating of 1-5 (5 is high) for a feature request. (High complexity implies more PR planning)
1
The text was updated successfully, but these errors were encountered: