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 - apk add --no-cache git
- yarn lint - 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 # Build
# #
@ -177,6 +186,7 @@ build-image:
- composer validate - composer validate
- yarn check - yarn check
- yarn lint - yarn lint
- translations lint
- generate-version - generate-version
dependencies: dependencies:
- generate-version - 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 docker compose exec -e THEMES=0,1 es_workspace yarn build
# Update the translation files # 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 # Run the migrations
docker compose exec es_workspace bin/migrate 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 * Generate translation files
```bash ```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 ## Testing

View File

@ -3,10 +3,24 @@
# immediate exit after an error # immediate exit after an error
set -e set -e
testing() {
echo
echo "🔎 Checking ${1}"
}
testing 'JS & CSS 🎨'
yarn check yarn check
yarn lint yarn lint
testing 'PHP ⚙️'
composer validate composer validate
composer phpcs composer phpcs
composer phpstan composer phpstan
./vendor/bin/phpunit ./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 FROM alpine AS translation
RUN apk add gettext RUN apk add gettext
COPY resources/lang/ /data 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 # Build the themes
FROM node:20-alpine AS 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" msgid "validation.email.email"
msgstr "Die E-Mail-Adresse ist nicht gültig." 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" msgid "validation.new_password.length"
msgstr "Dein neues Passwort ist zu kurz." msgstr "Dein neues Passwort ist zu kurz."

View File

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

View File

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

View File

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