2021-05-13 10:13:26 +00:00
|
|
|
#!/bin/bash
|
|
|
|
#
|
2023-05-18 11:59:02 +00:00
|
|
|
# Common functions to fetch languages.
|
2021-05-13 10:13:26 +00:00
|
|
|
#
|
|
|
|
|
2023-05-18 11:59:02 +00:00
|
|
|
LANG_PATH='../src/assets/lang'
|
|
|
|
SUFFIX='' # Determines suffix of the langpacks to be merged. Ie, using wp will include en.json and en_wp.json
|
|
|
|
# (and the later will override the earlier).
|
|
|
|
LANGPACKS_PATH='/tmp/moodleapp-lang'
|
2021-05-13 10:13:26 +00:00
|
|
|
|
2023-05-18 11:59:02 +00:00
|
|
|
# Get the version of the Moodle App to fetch latest languages.
|
|
|
|
function get_app_version {
|
2023-03-16 10:52:28 +00:00
|
|
|
if [ ! -z "${LANGVERSION}" ]; then
|
2021-05-13 10:13:26 +00:00
|
|
|
return
|
|
|
|
fi
|
|
|
|
|
2023-03-16 10:52:28 +00:00
|
|
|
APP_VERSION=`jq -r '.versionname' ../moodle.config.json| cut -d. -f1-2`
|
|
|
|
if [ ! -z $APP_VERSION ]; then
|
|
|
|
export LANGVERSION=$APP_VERSION
|
|
|
|
echo "Using app version $LANGVERSION"
|
2021-05-13 10:13:26 +00:00
|
|
|
return
|
|
|
|
fi
|
|
|
|
|
2023-05-18 11:59:02 +00:00
|
|
|
echo "Cannot decide version"
|
|
|
|
exit 1
|
2021-05-13 10:13:26 +00:00
|
|
|
}
|