Do not fail workflow if sunshine.po doesn't exist

- Add proper keywords for boost::locale
- Minor documentation updates about localization
This commit is contained in:
ReenigneArcher
2022-04-29 19:02:10 -04:00
parent ceb7f5f41a
commit b0a02a5985
3 changed files with 54 additions and 23 deletions

View File

@@ -9,6 +9,9 @@ on:
- 'locale/sunshine.po'
workflow_dispatch:
env:
file: ./locale/sunshine.po
jobs:
localize:
name: Update Localization
@@ -37,9 +40,20 @@ jobs:
- name: Update Strings
run: |
# first, try to remove existing file as xgettext does not remove unused translations
if [ -f "${{ env.file }}" ];
then
rm ${{ env.file }}
echo "new_file=false" >> $GITHUB_ENV
else
echo "new_file=true" >> $GITHUB_ENV
fi
# extract the new strings
python ./scripts/_locale.py --extract
- name: git diff
if: ${{ env.new_file == 'false' }}
run: |
# disable the pager
git config --global pager.diff false
@@ -52,7 +66,8 @@ jobs:
echo "git_diff=${OUTPUT}" >> $GITHUB_ENV
- name: git reset
if: ${{ env.git_diff == '1 1 locale/sunshine.po' }} # only run if more than 1 line changed
# only run if a single line changed (date/time) and file already existed
if: ${{ env.git_diff == '1 1 locale/sunshine.po' && env.new_file == 'false' }}
run: |
git reset --hard