| |
@@ -2,20 +2,29 @@
|
| |
echo "**********************************"
|
| |
echo "* Refresh fedora-docs/localization"
|
| |
|
| |
- # make sure we are in the folder of the current cript
|
| |
- pushd $(dirname $0) > /dev/null || exit
|
| |
+ # we expect a l10n folder containing all po/pot files in the parent folder
|
| |
+ RELATIVE_PATH="../"
|
| |
+ FOLDER_TO_SCAN="l10n"
|
| |
|
| |
- echo "* Runnning po Count"
|
| |
- pushd "../" > /dev/null || exit
|
| |
+ # make sure we are in the folder of the current script
|
| |
+ pushd "$(dirname "$0")" > /dev/null || exit
|
| |
+
|
| |
+ if [[ ! -d "$RELATIVE_PATH$FOLDER_TO_SCAN" ]]; then
|
| |
+ echo "The folder $FOLDER_TO_SCAN do not exist, exiting..."
|
| |
+ exit 1
|
| |
+ fi
|
| |
+
|
| |
+ echo "* Running po Count"
|
| |
+ pushd "$RELATIVE_PATH" > /dev/null || exit
|
| |
# pocount requires the installation of translate-toolkit
|
| |
- pocount --csv $(find l10n -name '*.po') >> stats/results.csv 2>> stats/error.log
|
| |
- pocount --csv $(find l10n -name '*.pot') | tail -n+2 >> stats/results.csv 2>> stats/error.log
|
| |
+ pocount --csv $(find "$FOLDER_TO_SCAN" -name '*.po') >> stats/results.csv 2>> stats/error.log
|
| |
+ pocount --csv $(find "$FOLDER_TO_SCAN" -name '*.pot') | tail -n+2 >> stats/results.csv 2>> stats/error.log
|
| |
popd > /dev/null || exit
|
| |
|
| |
echo "* Cloning"
|
| |
git clone https://pagure.io/fedora-docs/localization.git --quiet
|
| |
|
| |
- echo "* Installing Python depedencies with pip"
|
| |
+ echo "* Installing Python dependencies with pip"
|
| |
python3 -m venv venv
|
| |
source venv/bin/activate
|
| |
pip install pandas
|
| |
@@ -29,7 +38,7 @@
|
| |
git remote set-url --push origin ssh://git@pagure.io/fedora-docs/localization.git
|
| |
git add .
|
| |
git status --porcelain
|
| |
- git commit -m "Automated update" --quiet
|
| |
+ git commit -m "𝄠 Automated update 𝄟" --quiet
|
| |
git push --quiet
|
| |
popd > /dev/null || exit
|
| |
|
| |
the stats scripts is run after the global l10n pot update, but if it completely fails, there is no l10n folder to take translations from
the motivation to link both script is to reuses the "l10n" directory containing all po files, saving time & bandwith, and making sure stats match the reality