Lint & fix translations

This commit is contained in:
Igor Scheller 2023-12-07 16:20:37 +01:00 committed by Michael Weimann
parent 8b1cd8130e
commit ba4ba8f2f8
8 changed files with 27 additions and 21 deletions

View File

@ -155,6 +155,15 @@ yarn lint:
- apk add --no-cache git
- yarn lint
translations lint:
image: alpine
stage: prepare
before_script:
- apk add gettext
script:
- find resources/lang -type f -name '*.po' -exec sh -c 'msgfmt "${1%.*}.po" -o"${1%.*}.mo"' shell {} \;
- '[[ $(find resources/lang -type f -name "*.po" | wc -l) == $(find resources/lang -type f -name "*.mo" | wc -l) ]]'
#
# Build
#
@ -177,6 +186,7 @@ build-image:
- composer validate
- yarn check
- yarn lint
- translations lint
- generate-version
dependencies:
- generate-version

View File

@ -72,7 +72,7 @@ docker compose exec es_workspace yarn build
docker compose exec -e THEMES=0,1 es_workspace yarn build
# Update the translation files
docker compose exec es_workspace find /var/www/resources/lang -type f -name '*.po' -exec sh -c 'file="{}"; msgfmt "${file%.*}.po" -o "${file%.*}.mo"' \;
docker compose exec es_workspace find /var/www/resources/lang -type f -name '*.po' -exec sh -c 'msgfmt "${1%.*}.po" -o"${1%.*}.mo"' shell {} \;
# Run the migrations
docker compose exec es_workspace bin/migrate
@ -118,7 +118,7 @@ The following instructions explain how to get, build and run the latest Engelsys
```
* Generate translation files
```bash
find resources/lang/ -type f -name '*.po' -exec sh -c 'file="{}"; msgfmt "${file%.*}.po" -o "${file%.*}.mo"' \;
find resources/lang/ -type f -name '*.po' -exec sh -c 'msgfmt "${1%.*}.po" -o"${1%.*}.mo"' shell {} \;
```
## Testing

View File

@ -3,10 +3,24 @@
# immediate exit after an error
set -e
testing() {
echo
echo "🔎 Checking ${1}"
}
testing 'JS & CSS 🎨'
yarn check
yarn lint
testing 'PHP ⚙️'
composer validate
composer phpcs
composer phpstan
./vendor/bin/phpunit
testing 'translations 🗺️'
find resources/lang -type f -name '*.po' -exec sh -c 'msgfmt "${1%.*}.po" -o"${1%.*}.mo"' shell {} \;
[ "$(find resources/lang -type f -name '*.po' | wc -l)" -eq "$(find resources/lang -type f -name '*.mo' | wc -l)" ]
find resources/lang -type f -name '*.mo' -exec rm {} \;
echo '✅ Done 🎉'

View File

@ -8,7 +8,7 @@ RUN composer --no-ansi dump-autoload --optimize
FROM alpine AS translation
RUN apk add gettext
COPY resources/lang/ /data
RUN find /data -type f -name '*.po' -exec sh -c 'file="{}"; msgfmt "${file%.*}.po" -o "${file%.*}.mo"' \;
RUN find /data -type f -name '*.po' -exec sh -c 'msgfmt "${1%.*}.po" -o"${1%.*}.mo"' shell {} \;
# Build the themes
FROM node:20-alpine AS themes

View File

@ -52,9 +52,6 @@ msgstr "Bitte gib eine E-Mail-Adresse an."
msgid "validation.email.email"
msgstr "Die E-Mail-Adresse ist nicht gültig."
msgid "validation.password.length"
msgstr "Dein neues Passwort ist zu kurz."
msgid "validation.new_password.length"
msgstr "Dein neues Passwort ist zu kurz."

View File

@ -1095,18 +1095,12 @@ msgstr "Engel:"
msgid "Date, Duration:"
msgstr "Termin, Dauer:"
msgid "Location:"
msgstr "Ort:"
msgid "Title:"
msgstr "Titel:"
msgid "Type:"
msgstr "Typ:"
msgid "Location"
msgstr "Ort"
msgid "created at %s by %s"
msgstr "erstellt am %s von %s"
@ -1904,9 +1898,6 @@ msgid "angeltypes.hide_on_shift_view.info"
msgstr "Wenn ausgewählt, können nur Admins und Mitglieder des Engeltyps auf der "
"Schicht Seite die Filteroption für diesen Engeltyp sehen."
msgid "registration.register"
msgstr "Registrieren"
msgid "location.locations"
msgstr "Orte"

View File

@ -50,9 +50,6 @@ msgstr "The e-mail address is required."
msgid "validation.email.email"
msgstr "This e-mail address is not valid."
msgid "validation.password.length"
msgstr "Your new password is too short."
msgid "validation.new_password.length"
msgstr "Your new password is too short."

View File

@ -670,9 +670,6 @@ msgstr "Event data"
msgid "registration.what_todo"
msgstr "What do you want to do?"
msgid "registration.register"
msgstr "Register"
msgid "tshirt.required.hint"
msgstr "Please specify a T-shirt size in your settings!"