MOBILE-3833 lang: Add suffix param to get_languages
parent
d574776827
commit
6722c14397
|
@ -102,6 +102,15 @@ function get_language {
|
||||||
pushd $LANGPACKSFOLDER > /dev/null
|
pushd $LANGPACKSFOLDER > /dev/null
|
||||||
|
|
||||||
curl -s $MOODLEORG_URL/$lastversion/$lang.zip --output $lang.zip > /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
|
rm -R $lang > /dev/null 2>&1> /dev/null
|
||||||
unzip -o -u $lang.zip > /dev/null
|
unzip -o -u $lang.zip > /dev/null
|
||||||
|
|
||||||
|
@ -114,6 +123,8 @@ function get_language {
|
||||||
|
|
||||||
# Entry function to get all language files.
|
# Entry function to get all language files.
|
||||||
function get_languages {
|
function get_languages {
|
||||||
|
suffix=$1
|
||||||
|
|
||||||
get_last_version
|
get_last_version
|
||||||
|
|
||||||
if [ -d $LANGPACKSFOLDER ]; then
|
if [ -d $LANGPACKSFOLDER ]; then
|
||||||
|
@ -131,6 +142,7 @@ function get_languages {
|
||||||
|
|
||||||
if [ $AWS_SERVICE -eq 1 ]; then
|
if [ $AWS_SERVICE -eq 1 ]; then
|
||||||
get_all_languages_aws
|
get_all_languages_aws
|
||||||
|
suffix=''
|
||||||
else
|
else
|
||||||
echo "Fallback language list will only get current installation languages"
|
echo "Fallback language list will only get current installation languages"
|
||||||
get_installed_languages
|
get_installed_languages
|
||||||
|
@ -138,5 +150,9 @@ function get_languages {
|
||||||
|
|
||||||
for lang in $langs; do
|
for lang in $langs; do
|
||||||
get_language "$lang"
|
get_language "$lang"
|
||||||
|
|
||||||
|
if [ $suffix != '' ]; then
|
||||||
|
get_language "$lang$suffix"
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue