diff --git a/.github/workflows/spelling-gettext.yml b/.github/workflows/spelling-gettext.yml new file mode 100644 index 0000000..b038be4 --- /dev/null +++ b/.github/workflows/spelling-gettext.yml @@ -0,0 +1,49 @@ +# yaml-language-server: $schema=https://json.schemastore.org/github-workflow + +name: "Translations spelling" + +on: # yamllint disable-line rule:truthy + pull_request: null + push: + branches: + - "master" + workflow_call: null + +permissions: {} # yamllint disable-line rule:braces +#permissions: "read-all" +#permissions: +# contents: "read" # Private repositories need read permission + +concurrency: + group: "${{ github.workflow }}-${{ github.ref }}" + cancel-in-progress: true + +jobs: + hunspell_check: + name: "Hunspell" + runs-on: "ubuntu-latest" + timeout-minutes: 5 + steps: + - + name: "Checkout repository" + uses: "actions/checkout@v4" + - + name: "Install Hunspell" + run: "sudo -- apt-get install -y hunspell gettext" + - + name: "Checkout dictionaries" + #run: "git clone --depth=1 https://anongit.freedesktop.org/git/libreoffice/dictionaries.git dictionaries" + uses: "actions/checkout@v4" + with: + repository: "LibreOffice/dictionaries" + path: "libreoffice-dictionaries" + - + name: "Search for misspellings" + run: | + MISSPELLED_WORDS="$( + msgcat --no-wrap languages/*hu_HU.po \ + | sed -n -e 's#^msgstr "\(.\+\)"$#\1#p' \ + | hunspell -d ./libreoffice-dictionaries/hu_HU/hu_HU -p hunspell.txt -l + )" + echo "${MISSPELLED_WORDS}" + test -z "${MISSPELLED_WORDS}"