diff --git a/scripts/create_langindex.sh b/scripts/create_langindex.sh index 0135089ff..3171c270a 100755 --- a/scripts/create_langindex.sh +++ b/scripts/create_langindex.sh @@ -3,6 +3,7 @@ # Script to create langindex from available language packs. # ./create_langindex.sh [findbetter] # If findbetter is set it will try to find a better solution for every key. +# Edit lang_functions.sh LANGPACKSFOLDER variable to match your system's # source "functions.sh" diff --git a/scripts/lang_functions.sh b/scripts/lang_functions.sh index 2dc18ad05..a47044850 100755 --- a/scripts/lang_functions.sh +++ b/scripts/lang_functions.sh @@ -103,7 +103,7 @@ function get_language { 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 + if [ ! -n $lang.zip ] || [ $size -le 1 ]; then echo "Wrong language name or corrupt file for $lang" rm $lang.zip @@ -154,7 +154,7 @@ function get_languages { for lang in $langs; do get_language "$lang" - if [ $suffix != '' ]; then + if [ ! -z $suffix ]; then get_language "$lang$suffix" fi done diff --git a/scripts/update_lang.sh b/scripts/update_lang.sh index 7cd9d1120..4ba5157ed 100755 --- a/scripts/update_lang.sh +++ b/scripts/update_lang.sh @@ -3,12 +3,16 @@ # Script to update language packs on assets and detect new translated languages. # ./update_lang.sh [language] # If language is set it will only update the selected language. +# Edit lang_functions.sh LANGPACKSFOLDER variable to match your system's # source "functions.sh" source "lang_functions.sh" forceLang=$1 +print_title 'Generating language from code...' +npx gulp lang + print_title 'Getting local mobile langs' git clone --branch integration --depth 1 https://github.com/moodlehq/moodle-local_moodlemobileapp.git ../../moodle-local_moodlemobileapp