Skip to content

Commit 915c515

Browse files
author
ryan.kuba
committed
detect if firefox is installed in the container and download the langpacks for it
1 parent 0cb3bd5 commit 915c515

File tree

1 file changed

+15
-0
lines changed
  • root/etc/s6-overlay/s6-rc.d/init-mod-universal-internationalization-install

1 file changed

+15
-0
lines changed

root/etc/s6-overlay/s6-rc.d/init-mod-universal-internationalization-install/run

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -736,6 +736,21 @@ elif [[ "${LSIO_BASE}" == "arch" ]] && [[ ! -f /usr/share/fonts/noto-cjk/NotoSan
736736
echo "Generating Locale for ${LOCALE}"
737737
localedef -i ${LOCALE} -f UTF-8 ${LOCALE}.UTF-8
738738
done
739+
# Add Firefox Langpacks
740+
if which firefox; then
741+
FIREFOX_VERSION=$(curl -sI https://download.mozilla.org/?product=firefox-latest | awk -F '(releases/|/win32)' '/Location/ {print $2}')
742+
RELEASE_URL="https://releases.mozilla.org/pub/firefox/releases/${FIREFOX_VERSION}/win64/xpi/"
743+
LANGS=$(curl -Ls ${RELEASE_URL} | awk -F '(xpi">|</a>)' '/href.*xpi/ {print $2}' | tr '\n' ' ')
744+
EXTENSION_DIR=/usr/lib/firefox-addons/distribution/extensions/
745+
mkdir -p ${EXTENSION_DIR}
746+
for LANG in ${LANGS}; do
747+
LANGCODE=$(echo ${LANG} | sed 's/\.xpi//g')
748+
echo "Downloading ${LANG} Firefox Language pack"
749+
curl -o \
750+
${EXTENSION_DIR}langpack-${LANGCODE}@firefox.mozilla.org.xpi -Ls \
751+
${RELEASE_URL}${LANG}
752+
done
753+
fi
739754
else
740755
echo "**** International Fonts/Locales installed skipping ****"
741756
fi

0 commit comments

Comments
 (0)