From c7b4fcd77627e102eda3793a03b0f02383b84f43 Mon Sep 17 00:00:00 2001 From: Felix Kirchner Date: Fri, 22 May 2026 15:39:00 +0200 Subject: [PATCH] test gen l10n --- .gitea/workflows/pull_request.yaml | 58 ++++++++++++++++++++ lib/l10n/generated/app_localizations_de.dart | 48 +--------------- 2 files changed, 59 insertions(+), 47 deletions(-) diff --git a/.gitea/workflows/pull_request.yaml b/.gitea/workflows/pull_request.yaml index da2efba..8a42cf0 100644 --- a/.gitea/workflows/pull_request.yaml +++ b/.gitea/workflows/pull_request.yaml @@ -59,6 +59,7 @@ jobs: run: flutter test localizations: + if: false runs-on: ubuntu-latest steps: - name: Checkout code @@ -100,3 +101,60 @@ jobs: echo "All messages translated." + + + generate_localizations: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + # Required for Flutter action + - name: Install jq + run: | + apt-get update + apt-get install -y jq + + - name: Set up Flutter + uses: subosito/flutter-action@v2 + with: + channel: stable + flutter-version: 3.41.0 + + - name: Get dependencies + run: | + git config --global --add safe.directory /opt/hostedtoolcache/flutter/stable-3.41.0-x64 + flutter pub get + + + - name: Generate localization files + run: flutter gen-l10n --no-use-deferred-loading + + - name: Check code format + id: generate_localizations + continue-on-error: true + run: flutter gen-l10n --no-use-deferred-loading + + - name: Format code + if: steps.generate_localizations.outcome == 'failure' + env: + GITEA_TOKEN: ${{ secrets.BOT_TOKEN }} + run: | + # git fetch origin ${{ gitea.ref_name }} + git fetch origin ${{ gitea.head_ref }} + # git checkout ${{ gitea.ref_name }} + git checkout ${{ gitea.head_ref }} + + if [ -n "$(git status --porcelain lib test)" ]; then + git config --global user.name "Gitea Actions [bot]" + git config --global user.email "actions@yannick-weigert.de" + git config pull.rebase false + # git pull origin ${{ gitea.ref_name }} + git pull origin ${{ gitea.head_ref }} + git add lib/l10n + git commit -m "Generated localizations [skip ci]" + # git push origin HEAD:${{ gitea.ref_name }} + git push origin HEAD:${{ gitea.head_ref }} + else + echo "No changes to commit" + fi \ No newline at end of file diff --git a/lib/l10n/generated/app_localizations_de.dart b/lib/l10n/generated/app_localizations_de.dart index ea8e1f2..7fdffac 100644 --- a/lib/l10n/generated/app_localizations_de.dart +++ b/lib/l10n/generated/app_localizations_de.dart @@ -1,5 +1,6 @@ // ignore: unused_import import 'package:intl/intl.dart' as intl; + import 'app_localizations.dart'; // ignore_for_file: type=lint @@ -41,53 +42,6 @@ class AppLocalizationsDe extends AppLocalizations { @override String get color => 'Farbe'; - @override - String get color_blue => 'Blau'; - - @override - String get color_green => 'Grün'; - - @override - String get color_orange => 'Orange'; - - @override - String get color_pink => 'Rosa'; - - @override - String get color_purple => 'Lila'; - - @override - String get color_red => 'Rot'; - - @override - String get color_teal => 'Türkis'; - - @override - String get color_yellow => 'Gelb'; - - @override - String could_not_add_player(Object playerName) { - return 'Spieler:in $playerName konnte nicht hinzugefügt werden'; - } - - @override - String get create_game => 'Spielvorlage erstellen'; - - @override - String get create_group => 'Gruppe erstellen'; - - @override - String get create_match => 'Spiel erstellen'; - - @override - String get create_new_group => 'Neue Gruppe erstellen'; - - @override - String get created_on => 'Erstellt am'; - - @override - String get create_new_match => 'Neues Spiel erstellen'; - @override String get data => 'Daten';