Devilbox: Locale

Created on 20 Jun 2017  路  10Comments  路  Source: cytopia/devilbox

I was wondering if there is a possibility to configure the 'locale' to 'de_DE' for the httpd/php docker container?

docker feature

Most helpful comment

I can provide a whole bunch of locales inside the container by default.
Let's see if it can also be easily changeable.

All 10 comments

Its currently not supported, except if you alter the Dockerfile and rebuild the container.

What is the benefit of changing it to something else than the current default?

Okay :-)

The benefit would be that the localized use of strftime and other php functions that depend on the locale setting would work 馃憤

@laeckerv that is something that should be changed in your php.ini or actually on a per project base during project initialization and not on the server's timezone.

@cytopia :

Like this?

# test.php

<?php
    setlocale(LC_TIME, 'de_DE.UTF8');
    echo strftime("%#d %B", strtotime($ticket->date_created));
?>

As far as i understand this example needs to have the 'de_DE.UTF8' locale installed on the server? But by default only the following are installed.

[email protected] in /shared/httpd $ locale -a
C
POSIX
en_AG
en_AG.utf8
en_AU
en_AU.iso88591
en_AU.utf8
en_BW
en_BW.iso88591
en_BW.utf8
en_CA
en_CA.iso88591
en_CA.utf8
en_DK
en_DK.iso88591
en_DK.utf8
en_GB
en_GB.iso88591
en_GB.iso885915
en_GB.utf8
en_HK
en_HK.iso88591
en_HK.utf8
en_IE
en_IE.iso88591
en_IE.iso885915@euro
en_IE.utf8
en_IE@euro
en_IN
en_IN.utf8
en_NG
en_NG.utf8
en_NZ
en_NZ.iso88591
en_NZ.utf8
en_PH
en_PH.iso88591
en_PH.utf8
en_SG
en_SG.iso88591
en_SG.utf8
en_US
en_US.iso88591
en_US.iso885915
en_US.utf8
en_ZA
en_ZA.iso88591
en_ZA.utf8
en_ZM
en_ZM.utf8
en_ZW
en_ZW.iso88591
en_ZW.utf8

Update: I managed to add the de_DE.UTF8 by doing this with root (./root-bash.sh)
localedef -i de_DE -f UTF-8 de_DE.UTF-8

Still wondering if this would be possible with the env file for the docker-compose (I need to admit i don't fully understand the whole docker thing, yet) 馃憤

I can provide a whole bunch of locales inside the container by default.
Let's see if it can also be easily changeable.

@laeckerv do you know how to generate all locales under CentOS?

@laeckerv

I have rebuilt all PHP/HHVM Docker containers. The following locales have been added by default:
https://github.com/cytopia/docker-php-fpm-5.4/blob/master/Dockerfile#L313

Dockerhub will probably take 60 minutes for them being available. Once the time is up, you can update your containers (in latest devilbox master branch) via:

./update-docker.sh

@cytopia
Sorry for the lack of response, but I was on vacation. Thank your for this feature!

no worries, welcome

Was this page helpful?
0 / 5 - 0 ratings

Related issues

StanMenten99 picture StanMenten99  路  6Comments

zack6849 picture zack6849  路  5Comments

jonatanaxe picture jonatanaxe  路  5Comments

msyhr picture msyhr  路  7Comments

Novitsh picture Novitsh  路  6Comments