File tree Expand file tree Collapse file tree
DOCUMENTATION/content/documentation Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1300,6 +1300,19 @@ We also recommend [setting the timezone in Laravel](http://www.camroncade.com/ma
13001300
13011301
13021302
1303+ <br >
1304+ <a name =" Add locales to PHP-FPM " ></a >
1305+ ## Add locales to PHP-FPM
1306+
1307+ To add locales to the container:
1308+
1309+ 1 - Open the ` .env ` file and set ` PHP_FPM_INSTALL_ADDITIONAL_LOCALES ` to ` true ` .
1310+
1311+ 2 - Add locale codes to ` PHP_FPM_ADDITIONAL_LOCALES ` .
1312+
1313+ 3 - Re-build your PHP-FPM Container ` docker-compose build php-fpm ` .
1314+
1315+ 4 - Check enabled locales with ` docker-compose exec php-fpm locale -a `
13031316
13041317
13051318
Original file line number Diff line number Diff line change @@ -162,6 +162,8 @@ services:
162162 - INSTALL_IONCUBE=${PHP_FPM_INSTALL_IONCUBE}
163163 - INSTALL_APCU=${PHP_FPM_INSTALL_APCU}
164164 - INSTALL_YAML=${PHP_FPM_INSTALL_YAML}
165+ - INSTALL_ADDITIONAL_LOCALES=${PHP_FPM_INSTALL_ADDITIONAL_LOCALES}
166+ - ADDITIONAL_LOCALES=${PHP_FPM_ADDITIONAL_LOCALES}
165167 volumes :
166168 - ./php-fpm/php${PHP_VERSION}.ini:/usr/local/etc/php/php.ini
167169 - ${APP_CODE_PATH_HOST}:${APP_CODE_PATH_CONTAINER}${APP_CODE_CONTAINER_FLAG}
Original file line number Diff line number Diff line change @@ -169,6 +169,8 @@ PHP_FPM_INSTALL_IONCUBE=false
169169PHP_FPM_FAKETIME=-0
170170PHP_FPM_INSTALL_APCU=false
171171PHP_FPM_INSTALL_YAML=false
172+ PHP_FPM_INSTALL_ADDITIONAL_LOCALES=false
173+ PHP_FPM_ADDITIONAL_LOCALES="es_ES.UTF-8 fr_FR.UTF-8"
172174
173175### PHP_WORKER ############################################
174176
Original file line number Diff line number Diff line change @@ -585,6 +585,22 @@ RUN if [ ${INSTALL_YAML} = true ]; then \
585585 docker-php-ext-enable yaml \
586586;fi
587587
588+ # ##########################################################################
589+ # Install additional locales:
590+ # ##########################################################################
591+
592+ ARG INSTALL_ADDITIONAL_LOCALES=false
593+ ARG ADDITIONAL_LOCALES
594+
595+ RUN if [ ${INSTALL_ADDITIONAL_LOCALES} = true ]; then \
596+ apt-get install -y locales \
597+ && echo '' >> /usr/share/locale/locale.alias \
598+ && temp="${ADDITIONAL_LOCALES%\" }" \
599+ && temp="${temp#\" }" \
600+ && for i in ${temp}; do sed -i "/$i/s/^#//g" /etc/locale.gen; done \
601+ && locale-gen \
602+ ;fi
603+
588604# ##########################################################################
589605# Check PHP version:
590606# ##########################################################################
You can’t perform that action at this time.
0 commit comments