Skip to content

Commit 77d984e

Browse files
Santobertballoob
authored andcommitted
Add script to install locale (#25791)
1 parent e57ecc9 commit 77d984e

File tree

4 files changed

+19
-0
lines changed

4 files changed

+19
-0
lines changed

Dockerfile

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ LABEL maintainer="Paulus Schoutsen <[email protected]>"
1313
#ENV INSTALL_SSOCR no
1414
#ENV INSTALL_DLIB no
1515
#ENV INSTALL_IPERF3 no
16+
#ENV INSTALL_LOCALES no
1617

1718
VOLUME /config
1819

virtualization/Docker/Dockerfile.dev

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ LABEL maintainer="Paulus Schoutsen <[email protected]>"
1414
#ENV INSTALL_SSOCR no
1515
#ENV INSTALL_DLIB no
1616
#ENV INSTALL_IPERF3 no
17+
#ENV INSTALL_LOCALES no
1718

1819
VOLUME /config
1920

virtualization/Docker/scripts/locales

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/bash
2+
# Sets up locales.
3+
4+
# Stop on errors
5+
set -e
6+
7+
apt-get update
8+
apt-get install -y --no-install-recommends locales
9+
10+
# Set the locale
11+
sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen
12+
locale-gen

virtualization/Docker/setup_docker_prereqs

+5
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ INSTALL_OPENALPR="${INSTALL_OPENALPR:-yes}"
99
INSTALL_LIBCEC="${INSTALL_LIBCEC:-yes}"
1010
INSTALL_SSOCR="${INSTALL_SSOCR:-yes}"
1111
INSTALL_DLIB="${INSTALL_DLIB:-yes}"
12+
INSTALL_LOCALES="${INSTALL_LOCALES:-yes}"
1213

1314
# Required debian packages for running hass or components
1415
PACKAGES=(
@@ -70,6 +71,10 @@ if [ "$INSTALL_DLIB" == "yes" ]; then
7071
pip3 install --no-cache-dir "dlib>=19.5"
7172
fi
7273

74+
if [ "$INSTALL_LOCALES" == "yes" ]; then
75+
virtualization/Docker/scripts/locales
76+
fi
77+
7378
# Remove packages
7479
apt-get remove -y --purge ${PACKAGES_DEV[@]}
7580
apt-get -y --purge autoremove

0 commit comments

Comments
 (0)