2020-11-05 14:04:17 +00:00
|
|
|
#!/bin/bash
|
2021-05-13 10:13:26 +00:00
|
|
|
#
|
|
|
|
# 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.
|
2022-06-17 11:13:28 +00:00
|
|
|
# Edit lang_functions.sh LANGPACKSFOLDER variable to match your system's
|
2021-05-13 10:13:26 +00:00
|
|
|
#
|
2020-11-05 14:04:17 +00:00
|
|
|
source "functions.sh"
|
2021-05-13 10:13:26 +00:00
|
|
|
source "lang_functions.sh"
|
2020-11-05 14:04:17 +00:00
|
|
|
|
2021-05-13 10:13:26 +00:00
|
|
|
forceLang=$1
|
2020-11-05 14:04:17 +00:00
|
|
|
|
2022-06-17 11:13:28 +00:00
|
|
|
print_title 'Generating language from code...'
|
|
|
|
npx gulp lang
|
|
|
|
|
2020-11-05 14:04:17 +00:00
|
|
|
print_title 'Getting local mobile langs'
|
2023-03-16 10:52:28 +00:00
|
|
|
git clone --depth 1 https://github.com/moodlehq/moodle-local_moodlemobileapp.git ../../moodle-local_moodlemobileapp
|
2020-11-05 14:04:17 +00:00
|
|
|
|
|
|
|
if [ -z $forceLang ]; then
|
2021-05-13 10:13:26 +00:00
|
|
|
get_languages
|
2020-11-05 14:04:17 +00:00
|
|
|
php -f moodle_to_json.php
|
|
|
|
else
|
2021-05-13 10:13:26 +00:00
|
|
|
get_language "$forceLang"
|
2020-11-05 14:04:17 +00:00
|
|
|
php -f moodle_to_json.php "$forceLang"
|
|
|
|
fi
|
|
|
|
|
2022-11-03 09:44:54 +00:00
|
|
|
cp langindex.json ../../moodle-local_moodlemobileapp
|
|
|
|
|
2021-05-13 10:13:26 +00:00
|
|
|
print_ok 'All done!'
|