Skip to content

Implement robust localization infrastructure (l10n)#241

Merged
iberi22 merged 2 commits into
mainfrom
feat/localization-infrastructure-3378336104619687335
May 16, 2026
Merged

Implement robust localization infrastructure (l10n)#241
iberi22 merged 2 commits into
mainfrom
feat/localization-infrastructure-3378336104619687335

Conversation

@iberi22
Copy link
Copy Markdown
Owner

@iberi22 iberi22 commented May 15, 2026

I have implemented the requested localization infrastructure for the OrionHealth app.

Key changes:

  1. Project Configuration: Enabled generate: true in pubspec.yaml to support Flutter's localization tool.
  2. L10n Setup: Created l10n.yaml and established the lib/l10n directory for ARB files.
  3. Language Support: Initialized app_en.arb and app_es.arb with base strings (app title, home page content, navigation labels).
  4. App Integration: Updated lib/main.dart to use AppLocalizations for its strings and configured the necessary localizationsDelegates and supportedLocales.
  5. Verification: Created a new test test/l10n_test.dart that verifies correct string loading for both English and Spanish.

I also addressed code review feedback regarding the generation of localization files and dependency noise in pubspec.lock.

Fixes #239


PR created automatically by Jules for task 3378336104619687335 started by @iberi22

- Configured pubspec.yaml with generate: true.
- Created l10n.yaml for localization settings.
- Added initial English and Spanish ARB files in lib/l10n.
- Integrated AppLocalizations in lib/main.dart, replacing hardcoded strings.
- Added unit tests for localization verification.
@google-labs-jules
Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 15, 2026

Warning

Rate limit exceeded

@iberi22 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 58 minutes and 29 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 1e4b699c-1dc4-412b-81c2-24dd5cb9df6c

📥 Commits

Reviewing files that changed from the base of the PR and between 8369143 and 2c33963.

⛔ Files ignored due to path filters (1)
  • pubspec.lock is excluded by !**/*.lock
📒 Files selected for processing (9)
  • l10n.yaml
  • lib/l10n/app_en.arb
  • lib/l10n/app_es.arb
  • lib/l10n/app_localizations.dart
  • lib/l10n/app_localizations_en.dart
  • lib/l10n/app_localizations_es.dart
  • lib/main.dart
  • pubspec.yaml
  • test/l10n_test.dart
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/localization-infrastructure-3378336104619687335

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request implements internationalization support for English and Spanish by adding ARB files and integrating the Flutter localization framework into the main application and navigation components. Feedback highlights that generated localization files should not be manually checked into the repository when the automatic generation flag is enabled. Additionally, the reviewer advised against manual version downgrades in the lock file, suggesting that dependency management should be handled via the Flutter CLI.

Comment on lines +1 to +11
import 'dart:async';

import 'package:flutter/foundation.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
import 'package:intl/intl.dart' as intl;

import 'app_localizations_en.dart';
import 'app_localizations_es.dart';

// ignore_for_file: type=lint
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

It appears that app_localizations.dart and its associated implementation files (_en.dart, _es.dart) are generated code that has been manually added to the repository (indicated by the type=lint ignore and boilerplate structure).

Since generate: true is enabled in pubspec.yaml, Flutter's gen-l10n tool will automatically create these files in the .dart_tool/flutter_gen/ directory. Checking them into the source tree is generally discouraged as it leads to maintenance overhead and potential synchronization issues when .arb files are updated. For instance, the isSupported method (line 155) and lookupAppLocalizations (line 161) are currently hardcoded and would require manual updates whenever a new language is added.

Recommendation: Remove these files from lib/l10n/ and import from the synthetic package instead.

Comment thread lib/main.dart

import 'package:flutter/material.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
import 'l10n/app_localizations.dart';
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

If the manually added localization files are removed in favor of the automatically generated ones (as suggested in lib/l10n/app_localizations.dart), this import should be updated to point to the synthetic package generated by Flutter.

Suggested change
import 'l10n/app_localizations.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';

Comment thread pubspec.lock Outdated
url: "https://pub.dev"
source: hosted
version: "0.12.19"
version: "0.12.18"
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The version of matcher (and test_api at line 1496) is being downgraded. Manually editing the pubspec.lock file to reduce "noise" is risky and can lead to version mismatches or regressions. It is recommended to let the flutter pub tool manage this file. If you need to revert accidental upgrades, it is safer to adjust the constraints in pubspec.yaml and run flutter pub get again.

Comment thread test/l10n_test.dart
@@ -0,0 +1,47 @@
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:orionhealth_health/l10n/app_localizations.dart';
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

Update this import to use the generated localization package if the manual files are removed from the source tree.

Suggested change
import 'package:orionhealth_health/l10n/app_localizations.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';

@iberi22 iberi22 marked this pull request as ready for review May 16, 2026 01:46
@iberi22 iberi22 merged commit 24ee9c0 into main May 16, 2026
@iberi22 iberi22 deleted the feat/localization-infrastructure-3378336104619687335 branch May 16, 2026 01:48
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.

[feat] Implement robust localization infrastructure (l10n)

1 participant