From 915c515cd78d3dc8df2cf2328599ed0ff067a5ae Mon Sep 17 00:00:00 2001 From: "ryan.kuba" Date: Wed, 11 Oct 2023 19:34:10 -0700 Subject: [PATCH] detect if firefox is installed in the container and download the langpacks for it --- .../run | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/root/etc/s6-overlay/s6-rc.d/init-mod-universal-internationalization-install/run b/root/etc/s6-overlay/s6-rc.d/init-mod-universal-internationalization-install/run index 0fa10248..f02efb32 100755 --- a/root/etc/s6-overlay/s6-rc.d/init-mod-universal-internationalization-install/run +++ b/root/etc/s6-overlay/s6-rc.d/init-mod-universal-internationalization-install/run @@ -736,6 +736,21 @@ elif [[ "${LSIO_BASE}" == "arch" ]] && [[ ! -f /usr/share/fonts/noto-cjk/NotoSan echo "Generating Locale for ${LOCALE}" localedef -i ${LOCALE} -f UTF-8 ${LOCALE}.UTF-8 done + # Add Firefox Langpacks + if which firefox; then + 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">|)' '/href.*xpi/ {print $2}' | tr '\n' ' ') + EXTENSION_DIR=/usr/lib/firefox-addons/distribution/extensions/ + 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 else echo "**** International Fonts/Locales installed skipping ****" fi