mirror of
https://github.com/TrezOne/docker-mods-uptime-kuma-timeout-fix.git
synced 2026-07-19 09:53:02 -04:00
Merge pull request #771 from thelamer/universal-internationalization
detect if firefox is installed in the container and download the langs
This commit is contained in:
@@ -739,3 +739,26 @@ elif [[ "${LSIO_BASE}" == "arch" ]] && [[ ! -f /usr/share/fonts/noto-cjk/NotoSan
|
|||||||
else
|
else
|
||||||
echo "**** International Fonts/Locales installed skipping ****"
|
echo "**** International Fonts/Locales installed skipping ****"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Add Firefox Langpacks
|
||||||
|
if which firefox && [ ! -f /langlock ]; then
|
||||||
|
echo "Installing firefox langpacks"
|
||||||
|
FIREFOX_VERSION=$(curl -sI https://download.mozilla.org/?product=firefox-latest | awk -F '(releases/|/win32)' '/Location/ {print $2}')
|
||||||
|
RELEASE_URL="https://releases.mozilla.org/pub/firefox/releases/${FIREFOX_VERSION}/win64/xpi/"
|
||||||
|
LANGS=$(curl -Ls ${RELEASE_URL} | awk -F '(xpi">|</a>)' '/href.*xpi/ {print $2}' | tr '\n' ' ')
|
||||||
|
if [[ "${LSIO_BASE}" == "alpine" ]]; then
|
||||||
|
EXTENSION_DIR=/usr/lib/firefox/distribution/extensions/
|
||||||
|
else
|
||||||
|
EXTENSION_DIR=/usr/lib/firefox-addons/distribution/extensions/
|
||||||
|
fi
|
||||||
|
mkdir -p ${EXTENSION_DIR}
|
||||||
|
for LANG in ${LANGS}; do
|
||||||
|
LANGCODE=$(echo ${LANG} | sed 's/\.xpi//g')
|
||||||
|
echo "Downloading ${LANG} Firefox Language pack"
|
||||||
|
curl -o \
|
||||||
|
${EXTENSION_DIR}langpack-${LANGCODE}@firefox.mozilla.org.xpi -Ls \
|
||||||
|
${RELEASE_URL}${LANG}
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
|
touch /langlock
|
||||||
|
|||||||
Reference in New Issue
Block a user