diff --git a/.github/scripts/check_l10n.php b/.github/scripts/check_l10n.php new file mode 100644 index 0000000..482034a --- /dev/null +++ b/.github/scripts/check_l10n.php @@ -0,0 +1,56 @@ + $l10nval ) { + if( !isset($checkLang[$l10nKey]) || empty($checkLang[$l10nKey]) ) { + echo basename($langfile)." is missing translation for key ".$l10nKey.PHP_EOL; + $errors++; + } + } +} + +if( $errors > 0 ) { + phpDie("l10n check failed with ".$errors." errors"); +} + + +function phpDie($msg) { + echo $msg.PHP_EOL; + exit(1); +} diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 54a02b4..7ee559d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -26,6 +26,8 @@ jobs: java-version: '8' - name: "Build jar" run: | + php $GITHUB_WORKSPACE/.github/scripts/check_l10n.php src/main/resources/l10n + [ $? -eq 0 ] || die "Missing translations" jar_file="build/ESP32PartitionTool.jar" . $GITHUB_WORKSPACE/.github/scripts/build_jar.sh $jar_file [ $? -eq 0 ] || die "Jar creation failed" @@ -60,4 +62,4 @@ jobs: with: files: | /home/runner/work/esp32partitiontool/esp32partitiontool/archives/** - token: ${{ secrets.RELEASE_TOKEN }} # Use the secret here \ No newline at end of file + token: ${{ secrets.RELEASE_TOKEN }} # Use the secret here