Skip to content

Add Swiss German translations, settings page with language/theme controls, and GitHub contributors link - #20

Draft
tujii with Copilot wants to merge 3 commits into
masterfrom
copilot/add-swiss-german-translations
Draft

Add Swiss German translations, settings page with language/theme controls, and GitHub contributors link#20
tujii with Copilot wants to merge 3 commits into
masterfrom
copilot/add-swiss-german-translations

Conversation

Copilot AI commented Dec 12, 2025

Copy link
Copy Markdown
Contributor

Adds Swiss German (Schwiizerdütsch) as a third supported language alongside English and German. Implements a settings page accessible to all users (authenticated or guest) with language selection, dark/light theme toggle, and a link to the GitHub repository for discovering contributors.

Changes

Localization

  • Swiss German translations (app_gsw.arb): Complete 265-key translation file
  • First-launch language selector: Dialog prompts language choice on initial app start, never shown again
  • Language switching: Runtime locale changes without restart via main.dart state management

Settings Page

  • New settings screen accessible from app bar icon (all users, including guests)
  • Language selector: Radio list for English/Deutsch/Schwiizerdütsch with visual feedback
  • Theme toggle: Light/dark mode switching with immediate apply
  • GitHub link: Opens https://github.com/tujii/angry_raphi_flutter in external browser via url_launcher

Persistence Layer

  • PreferencesService: Wrapper around SharedPreferences for language/theme storage
  • State restoration: Loads saved preferences on app start, defaults to English/light mode
  • Guest support: All preferences work without authentication

Implementation

Language and theme state lives in _AngryRaphiAppState, cascades through AppWrapper to PublicUserListPage:

// main.dart
class _AngryRaphiAppState extends State<AngryRaphiApp> {
  Locale _locale = const Locale('en');
  ThemeMode _themeMode = ThemeMode.light;
  
  Future<void> _initializeSettings() async {
    final savedLanguage = await _preferencesService.getLanguage();
    final savedTheme = await _preferencesService.getTheme();
    final isFirstLaunch = await _preferencesService.isFirstLaunch();
    
    setState(() {
      if (savedLanguage != null) _locale = Locale(savedLanguage);
      if (savedTheme != null) _themeMode = savedTheme == 'dark' ? ThemeMode.dark : ThemeMode.light;
    });
    
    if (isFirstLaunch) _showLanguageSelector();
  }
}

Settings page uses callbacks to update parent state and persists changes immediately:

// settings_page.dart
onTap: () async {
  widget.onLanguageChanged(locale);
  await _preferencesService.setLanguage(locale.languageCode);
}

Dependencies

  • shared_preferences: ^2.3.4 (already present)
  • url_launcher: ^6.3.1 (already present)

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://storage.googleapis.com/flutter_infra_release/flutter/1527ae0ec577a4ef50e65f6fefcfc1326707d9bf/dart-sdk-linux-x64.zip
    • Triggering command: /usr/bin/curl curl --retry 3 --continue-at - --location --output /home/REDACTED/flutter/bin/cache/dart-sdk-linux-x64.zip REDACTED (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>Add Swiss German translations, language selector, theme toggle, and GitHub contributors link in settings</issue_title>
<issue_description>Feature summary

  • Add Swiss German (Schwiizerdütsch) to the available app translations.
  • Prompt users on their first app launch to choose their preferred language, providing options in a selection dialog.
  • Allow users to change language later from the Settings screen, even if they are not logged in.
  • Implement dark mode and light mode toggling directly within the Settings screen.
  • Add a clickable link in Settings to the GitHub repo (https://github.com/tujii/angry_raphi_flutter), with text like "Search for contributors." This should open the repo so users can view contributors or get involved.

Acceptance criteria

  • Swiss German is selectable and fully supported in translations.
  • Language selector is shown at first app start and also accessible in Settings (for all users, including guests).
  • Theme choice (dark/light) can be toggled in Settings.
  • GitHub repo link is prominently accessible in Settings for discovering contributors.

Notes

  • Consider persisting language and theme choice for guest (not-logged-in) users, using local storage or equivalents.
  • The GitHub link should open in the system browser.

Feel free to suggest UI improvements if there is a more intuitive way to present these settings.</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits December 12, 2025 20:21
…toggles, and GitHub contributors link

Co-authored-by: tujii <8914318+tujii@users.noreply.github.com>
Co-authored-by: tujii <8914318+tujii@users.noreply.github.com>
@tujii

tujii commented Dec 12, 2025

Copy link
Copy Markdown
Owner

@copilot was ist Run CodeQL security checker
und wo sehe ich das ergbenis

Copilot AI changed the title [WIP] Add Swiss German translations and settings enhancements Add Swiss German translations, settings page with language/theme controls, and GitHub contributors link Dec 12, 2025
Copilot AI requested a review from tujii December 12, 2025 20:31

Copilot AI commented Dec 12, 2025

Copy link
Copy Markdown
Contributor Author

@copilot was ist Run CodeQL security checker
und wo sehe ich das ergbenis

CodeQL ist ein Security-Scanner von GitHub, der automatisch nach Sicherheitslücken im Code sucht.

Ich habe den CodeQL-Check während der Entwicklung ausgeführt. Das Ergebnis war: "No code changes detected for languages that CodeQL can analyze" - es wurden keine Sicherheitsprobleme gefunden.

CodeQL unterstützt hauptsächlich Backend-Sprachen (Python, JavaScript, Java, C++, etc.), aber nicht Dart/Flutter. Da deine App in Flutter geschrieben ist, wurde keine vollständige Analyse durchgeführt.

Für Flutter-Projekte kannst du stattdessen flutter analyze verwenden, was in deiner CI/CD Pipeline (.github/workflows/ci-cd.yml) bereits konfiguriert ist. Die Ergebnisse siehst du unter "Actions" → "CI/CD Pipeline" in deinem GitHub Repository.

@tujii

tujii commented Dec 12, 2025

Copy link
Copy Markdown
Owner

@copilot wäre es dann besser sonar hier einzubauen ? es muss aber kostenlos sein

Copilot AI commented Dec 12, 2025

Copy link
Copy Markdown
Contributor Author

@copilot wäre es dann besser sonar hier einzubauen ? es muss aber kostenlos sein

SonarCloud ist für Open-Source-Projekte kostenlos und eine gute Option für Flutter-Projekte.

Vorteile:

  • Erkennt Code-Smells, Bugs und Security-Schwachstellen
  • Funktioniert mit Dart (begrenzt, aber besser als CodeQL)
  • Kostenlos für öffentliche GitHub-Repos
  • Zeigt Code-Coverage und technische Schulden

Setup: Du kannst SonarCloud unter https://sonarcloud.io mit deinem GitHub-Account verbinden. Für Flutter brauchst du eine sonar-project.properties Datei.

Alternative: Für Flutter-spezifische Analyse ist dart analyze mit Custom Lint Rules (wie flutter_lints: ^5.0.0, das du bereits verwendest) oft ausreichend. Du könntest auch dart_code_metrics hinzufügen für detailliertere Metriken.

Für dieses Projekt würde ich empfehlen: Bleib erstmal bei flutter analyze in der CI/CD. SonarCloud kannst du später hinzufügen, wenn du mehr Metriken brauchst.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Swiss German translations, language selector, theme toggle, and GitHub contributors link in settings

2 participants