CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
sagemathinc

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.

GitHub Repository: sagemathinc/cocalc
Path: blob/master/src/packages/next/locales/download.sh
Views: 791
1
#!/usr/bin/env bash
2
. ./locales/common.sh
3
4
check_api_key
5
6
# Each language is downloaded into a spearate file and compiled – this allows for dynamic imports.
7
download() {
8
local lang="$1"
9
echo "calling download '$lang'"
10
simplelocalize download \
11
--apiKey "$SIMPLELOCALIZE_KEY_NEXT" \
12
--downloadPath "./locales/{lang}/{ns}.json" \
13
--downloadFormat single-language-json \
14
--languageKey="$lang"
15
}
16
17
if command -v parallel &>/dev/null; then
18
echo "Parallel is installed. Running downloads in parallel."
19
export -f download
20
echo "$LANGS" | tr ' ' '\n' | parallel -j8 --delay 0.1 --will-cite download
21
else
22
echo "Parallel is not installed. Running downloads sequentially."
23
for L in $LANGS; do
24
download "$L"
25
done
26
fi
27
28