MOBILE-3833 lang: Add suffix param to get_languages

main
Pau Ferrer Ocaña 2021-11-30 09:22:01 +01:00
parent d574776827
commit 6722c14397
1 changed files with 16 additions and 0 deletions

View File

@ -102,6 +102,15 @@ function get_language {
pushd $LANGPACKSFOLDER > /dev/null
curl -s $MOODLEORG_URL/$lastversion/$lang.zip --output $lang.zip > /dev/null
size=$(du -k "$lang.zip" | cut -f 1)
if [ ! -n $lang.zip ] || [ $size -le 60 ]; then
echo "Wrong language name or corrupt file for $lang"
rm $lang.zip
popd > /dev/null
return
fi
rm -R $lang > /dev/null 2>&1> /dev/null
unzip -o -u $lang.zip > /dev/null
@ -114,6 +123,8 @@ function get_language {
# Entry function to get all language files.
function get_languages {
suffix=$1
get_last_version
if [ -d $LANGPACKSFOLDER ]; then
@ -131,6 +142,7 @@ function get_languages {
if [ $AWS_SERVICE -eq 1 ]; then
get_all_languages_aws
suffix=''
else
echo "Fallback language list will only get current installation languages"
get_installed_languages
@ -138,5 +150,9 @@ function get_languages {
for lang in $langs; do
get_language "$lang"
if [ $suffix != '' ]; then
get_language "$lang$suffix"
fi
done
}