Skip to content

Commit 269ce17

Browse files
authored
Merge pull request #56 from linuxserver/default-lang
2 parents e4e4f81 + cad3445 commit 269ce17

File tree

4 files changed

+32
-25
lines changed

4 files changed

+32
-25
lines changed

Dockerfile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,14 @@ RUN \
4242
/tmp/projectsend.zip -d \
4343
/app/www/public && \
4444
mv /app/www/public/upload /defaults/ && \
45+
echo "**** download default lang files ****" && \
46+
mkdir -p /defaults/lang && \
47+
curl -fso \
48+
/defaults/lang/en.mo -L \
49+
"https://raw.githubusercontent.com/projectsend/projectsend/refs/heads/develop/templates/default/lang/en.mo" && \
50+
curl -fso \
51+
/defaults/lang/en.po -L \
52+
"https://raw.githubusercontent.com/projectsend/projectsend/refs/heads/develop/templates/default/lang/en.po" && \
4553
printf "Linuxserver.io version: ${VERSION}\nBuild-date: ${BUILD_DATE}" > /build_version && \
4654
echo "**** cleanup ****" && \
4755
rm -rf \

Dockerfile.aarch64

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,14 @@ RUN \
4242
/tmp/projectsend.zip -d \
4343
/app/www/public && \
4444
mv /app/www/public/upload /defaults/ && \
45+
echo "**** download default lang files ****" && \
46+
mkdir -p /defaults/lang && \
47+
curl -fso \
48+
/defaults/lang/en.mo -L \
49+
"https://raw.githubusercontent.com/projectsend/projectsend/refs/heads/develop/templates/default/lang/en.mo" && \
50+
curl -fso \
51+
/defaults/lang/en.po -L \
52+
"https://raw.githubusercontent.com/projectsend/projectsend/refs/heads/develop/templates/default/lang/en.po" && \
4553
printf "Linuxserver.io version: ${VERSION}\nBuild-date: ${BUILD_DATE}" > /build_version && \
4654
echo "**** cleanup ****" && \
4755
rm -rf \

readme-vars.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ init_diagram: |
8888
"projectsend:latest" <- Base Images
8989
# changelog
9090
changelogs:
91+
- {date: "16.11.25:", desc: "Add missing language files to default install."}
9192
- {date: "14.10.25:", desc: "Rebase to 3.22."}
9293
- {date: "06.06.25:", desc: "Add crontab handler for scheduled tasks."}
9394
- {date: "21.12.24:", desc: "Rebase to Alpine 3.21, move php .ini file to /config/php."}

root/etc/s6-overlay/s6-rc.d/init-projectsend-config/run

Lines changed: 15 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -56,18 +56,9 @@ fi
5656

5757
#Handle translations
5858
mkdir -p /config/translations
59-
6059
shopt -s globstar dotglob
6160

6261
#check if there are newer translation files in the container and if so copy them to /config
63-
if [[ -d /config/translations/lang && ! -L /app/www/public/lang ]]; then
64-
for file in /app/www/public/lang/*; do
65-
if [ $(date -r "$file" +%s) -ge $(date -r "/config/translations/lang/$(echo $file | awk -F '/' '{print $(NF)}')" +%s) ]; then
66-
cp "$file" /config/translations/lang/
67-
fi
68-
done
69-
fi
70-
# symlink translations
7162
if [[ -d /config/translations/lang && ! -L /app/www/public/lang ]]; then
7263
rm -rf /app/www/public/lang
7364
fi
@@ -77,6 +68,10 @@ fi
7768
if [[ -d /config/translations/lang && ! -L /app/www/public/lang ]]; then
7869
ln -s /config/translations/lang /app/www/public/lang
7970
fi
71+
if [[ ! -f /config/translations/lang/en.po ]] || [[ ! -f /config/translations/lang/en.mo ]]; then
72+
mkdir -p /config/translations/lang
73+
cp /defaults/lang/* /config/translations/lang/
74+
fi
8075

8176
symlinks=(
8277
/app/www/public/templates/default/lang
@@ -85,26 +80,21 @@ symlinks=(
8580
)
8681

8782
for i in "${symlinks[@]}"; do
88-
path=$(echo "$i" | awk -F '/' '{print $(NF-1)"/"$NF}')
89-
#check if there are newer translation files in the container and if so copy them to /config
90-
if [[ -d /config/translations/"$path" && ! -L "$i" ]]; then
91-
for file in "$i"/*; do
92-
if [ $(date -r "$file" +%s) -ge $(date -r "/config/translations/$(echo $i | awk -F '/' '{print $(NF-1)}')/$(echo $file | awk -F '/' '{print $(NF)}')" +%s) ]; then
93-
cp "$file" "/config/translations/$(echo $i | awk -F '/' '{print $(NF-1)}')"
94-
fi
95-
done
96-
fi
83+
path=$(echo "${i}" | awk -F '/' '{print $(NF-1)}')
9784
# symlink translations
98-
if [[ -d /config/translations/"$path" && ! -L "$i" ]]; then
99-
rm -rf "$i"
85+
if [[ -d /config/translations/"$path" && ! -L "${i}" ]]; then
86+
rm -rf "${i}"
10087
fi
101-
if [[ ! -d /config/translations/"$path" && ! -L "$i" ]]; then
102-
mv "$i" /config/translations/"$(echo $i | awk -F '/' '{print $(NF-1)}')"
88+
if [[ ! -d /config/translations/"$path" && ! -L "${i}" ]]; then
89+
mv "$i" /config/translations/"$(echo "${i}" | awk -F '/' '{print $(NF-1)}')"
10390
fi
104-
if [[ -d /config/translations/"$path" && ! -L "$i" ]]; then
105-
ln -s /config/translations/"$path" "$i"
91+
if [[ -d /config/translations/"$path" && ! -L "${i}" ]]; then
92+
ln -s /config/translations/"$path" "${i}"
93+
fi
94+
if [[ ! -f /config/translations/"$path"/en.po ]] || [[ ! -f /config/translations/"$path"/en.mo ]]; then
95+
mkdir -p /config/translations/"$path"
96+
cp /defaults/lang/* /config/translations/"$path"/
10697
fi
107-
10898
done
10999

110100
shopt -u globstar dotglob

0 commit comments

Comments
 (0)