mirror of
https://github.com/linuxserver/docker-projectsend.git
synced 2026-02-20 08:39:17 +08:00
Merge pull request #56 from linuxserver/default-lang
This commit is contained in:
commit
269ce171c4
@ -42,6 +42,14 @@ RUN \
|
||||
/tmp/projectsend.zip -d \
|
||||
/app/www/public && \
|
||||
mv /app/www/public/upload /defaults/ && \
|
||||
echo "**** download default lang files ****" && \
|
||||
mkdir -p /defaults/lang && \
|
||||
curl -fso \
|
||||
/defaults/lang/en.mo -L \
|
||||
"https://raw.githubusercontent.com/projectsend/projectsend/refs/heads/develop/templates/default/lang/en.mo" && \
|
||||
curl -fso \
|
||||
/defaults/lang/en.po -L \
|
||||
"https://raw.githubusercontent.com/projectsend/projectsend/refs/heads/develop/templates/default/lang/en.po" && \
|
||||
printf "Linuxserver.io version: ${VERSION}\nBuild-date: ${BUILD_DATE}" > /build_version && \
|
||||
echo "**** cleanup ****" && \
|
||||
rm -rf \
|
||||
|
||||
@ -42,6 +42,14 @@ RUN \
|
||||
/tmp/projectsend.zip -d \
|
||||
/app/www/public && \
|
||||
mv /app/www/public/upload /defaults/ && \
|
||||
echo "**** download default lang files ****" && \
|
||||
mkdir -p /defaults/lang && \
|
||||
curl -fso \
|
||||
/defaults/lang/en.mo -L \
|
||||
"https://raw.githubusercontent.com/projectsend/projectsend/refs/heads/develop/templates/default/lang/en.mo" && \
|
||||
curl -fso \
|
||||
/defaults/lang/en.po -L \
|
||||
"https://raw.githubusercontent.com/projectsend/projectsend/refs/heads/develop/templates/default/lang/en.po" && \
|
||||
printf "Linuxserver.io version: ${VERSION}\nBuild-date: ${BUILD_DATE}" > /build_version && \
|
||||
echo "**** cleanup ****" && \
|
||||
rm -rf \
|
||||
|
||||
@ -88,6 +88,7 @@ init_diagram: |
|
||||
"projectsend:latest" <- Base Images
|
||||
# changelog
|
||||
changelogs:
|
||||
- {date: "16.11.25:", desc: "Add missing language files to default install."}
|
||||
- {date: "14.10.25:", desc: "Rebase to 3.22."}
|
||||
- {date: "06.06.25:", desc: "Add crontab handler for scheduled tasks."}
|
||||
- {date: "21.12.24:", desc: "Rebase to Alpine 3.21, move php .ini file to /config/php."}
|
||||
|
||||
@ -56,18 +56,9 @@ fi
|
||||
|
||||
#Handle translations
|
||||
mkdir -p /config/translations
|
||||
|
||||
shopt -s globstar dotglob
|
||||
|
||||
#check if there are newer translation files in the container and if so copy them to /config
|
||||
if [[ -d /config/translations/lang && ! -L /app/www/public/lang ]]; then
|
||||
for file in /app/www/public/lang/*; do
|
||||
if [ $(date -r "$file" +%s) -ge $(date -r "/config/translations/lang/$(echo $file | awk -F '/' '{print $(NF)}')" +%s) ]; then
|
||||
cp "$file" /config/translations/lang/
|
||||
fi
|
||||
done
|
||||
fi
|
||||
# symlink translations
|
||||
if [[ -d /config/translations/lang && ! -L /app/www/public/lang ]]; then
|
||||
rm -rf /app/www/public/lang
|
||||
fi
|
||||
@ -77,6 +68,10 @@ fi
|
||||
if [[ -d /config/translations/lang && ! -L /app/www/public/lang ]]; then
|
||||
ln -s /config/translations/lang /app/www/public/lang
|
||||
fi
|
||||
if [[ ! -f /config/translations/lang/en.po ]] || [[ ! -f /config/translations/lang/en.mo ]]; then
|
||||
mkdir -p /config/translations/lang
|
||||
cp /defaults/lang/* /config/translations/lang/
|
||||
fi
|
||||
|
||||
symlinks=(
|
||||
/app/www/public/templates/default/lang
|
||||
@ -85,26 +80,21 @@ symlinks=(
|
||||
)
|
||||
|
||||
for i in "${symlinks[@]}"; do
|
||||
path=$(echo "$i" | awk -F '/' '{print $(NF-1)"/"$NF}')
|
||||
#check if there are newer translation files in the container and if so copy them to /config
|
||||
if [[ -d /config/translations/"$path" && ! -L "$i" ]]; then
|
||||
for file in "$i"/*; do
|
||||
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
|
||||
cp "$file" "/config/translations/$(echo $i | awk -F '/' '{print $(NF-1)}')"
|
||||
fi
|
||||
done
|
||||
fi
|
||||
path=$(echo "${i}" | awk -F '/' '{print $(NF-1)}')
|
||||
# symlink translations
|
||||
if [[ -d /config/translations/"$path" && ! -L "$i" ]]; then
|
||||
rm -rf "$i"
|
||||
if [[ -d /config/translations/"$path" && ! -L "${i}" ]]; then
|
||||
rm -rf "${i}"
|
||||
fi
|
||||
if [[ ! -d /config/translations/"$path" && ! -L "$i" ]]; then
|
||||
mv "$i" /config/translations/"$(echo $i | awk -F '/' '{print $(NF-1)}')"
|
||||
if [[ ! -d /config/translations/"$path" && ! -L "${i}" ]]; then
|
||||
mv "$i" /config/translations/"$(echo "${i}" | awk -F '/' '{print $(NF-1)}')"
|
||||
fi
|
||||
if [[ -d /config/translations/"$path" && ! -L "$i" ]]; then
|
||||
ln -s /config/translations/"$path" "$i"
|
||||
if [[ -d /config/translations/"$path" && ! -L "${i}" ]]; then
|
||||
ln -s /config/translations/"$path" "${i}"
|
||||
fi
|
||||
if [[ ! -f /config/translations/"$path"/en.po ]] || [[ ! -f /config/translations/"$path"/en.mo ]]; then
|
||||
mkdir -p /config/translations/"$path"
|
||||
cp /defaults/lang/* /config/translations/"$path"/
|
||||
fi
|
||||
|
||||
done
|
||||
|
||||
shopt -u globstar dotglob
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user