Skip to content

Add localization support with flutter_localizations#9

Merged
rileychh merged 2 commits intomainfrom
i18n
Jan 23, 2026
Merged

Add localization support with flutter_localizations#9
rileychh merged 2 commits intomainfrom
i18n

Conversation

@rileychh
Copy link
Member

This PR adds internationalization (i18n) foundation to the app using Flutter's official localization framework.

Changes

  • Localization setup: Added l10n.yaml configuration for ARB file generation
  • Language support: Configured English (en) and Chinese (zh) locales
  • ARB files: Created template ARB files with placeholder appTitle string
  • Generated code: Auto-generated AppLocalizations classes and locale-specific implementations
  • Dependencies: Added flutter_localizations SDK dependency and enabled flutter.generate in pubspec.yaml

Implementation Details

The localization system uses:

  • lib/l10n/app_en.arb - English template with string descriptions
  • lib/l10n/app_zh.arb - Chinese translations
  • Auto-generated AppLocalizations delegate with supportedLocales for en/zh
  • Type-safe access to localized strings via AppLocalizations.of(context)

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds Flutter gen-l10n–based localization scaffolding (ARB files + generated AppLocalizations) and enables localization code generation in the app.

Changes:

  • Added flutter_localizations SDK dependency and enabled flutter: generate: true
  • Added l10n.yaml plus initial en/zh ARB files
  • Added generated localization Dart sources under lib/l10n/

Reviewed changes

Copilot reviewed 7 out of 8 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
pubspec.yaml Adds flutter_localizations and enables Flutter code generation.
pubspec.lock Locks the new SDK dependency entry for flutter_localizations.
l10n.yaml Configures gen-l10n to read ARB files and emit app_localizations.dart.
lib/l10n/app_en.arb Adds English template ARB entry for appTitle (with description metadata).
lib/l10n/app_zh.arb Adds Chinese locale ARB entry for appTitle.
lib/l10n/app_localizations.dart Adds the generated AppLocalizations base class, delegate, and supported locales.
lib/l10n/app_localizations_en.dart Adds generated English implementation.
lib/l10n/app_localizations_zh.dart Adds generated Chinese implementation.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@rileychh rileychh merged commit bfed237 into main Jan 23, 2026
9 checks passed
@rileychh rileychh deleted the i18n branch January 23, 2026 16:11
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.

2 participants