Skip to content

Re-export public_ext from generated LocaleKeys file#786

Open
j4qfrost wants to merge 1 commit into
aissat:developfrom
j4qfrost:feature/export-public-ext-from-generated
Open

Re-export public_ext from generated LocaleKeys file#786
j4qfrost wants to merge 1 commit into
aissat:developfrom
j4qfrost:feature/export-public-ext-from-generated

Conversation

@j4qfrost
Copy link
Copy Markdown

@j4qfrost j4qfrost commented May 1, 2026

Closes #780.

Adds export 'package:easy_localization/src/public_ext.dart'; to the generated file's header. Consumers that already import the generated locale_keys.g.dart (e.g. import 'generated/locale_keys.g.dart';) now also pick up the Text.tr() / Text.plural() extensions without a second import 'package:easy_localization/easy_localization.dart'; line — eliminating the two-import requirement called out in the issue.

Summary by CodeRabbit

  • New Features
    • Generated localization modules now automatically export localization utilities and extensions, providing developers with direct and simplified access to essential localization features without requiring manual imports throughout their projects.
    • This enhancement streamlines the localization workflow, reduces boilerplate code, and significantly improves the overall developer experience when building multilingual and internationalized applications across platforms.

Closes aissat#780.

Adds `export 'package:easy_localization/src/public_ext.dart';` to the
generated file's header. Consumers that already import the generated
`locale_keys.g.dart` (e.g. `import 'generated/locale_keys.g.dart';`)
now also pick up the `Text.tr()` / `Text.plural()` extensions without
a second `import 'package:easy_localization/easy_localization.dart';`
line — eliminating the two-import requirement called out in the issue.
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 1, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 72d9588f-3a2d-45ec-aa3b-daa0b70c5cec

📥 Commits

Reviewing files that changed from the base of the PR and between 8fda76d and a0c4407.

📒 Files selected for processing (1)
  • bin/generate.dart

Walkthrough

The generator now adds an export directive for easy_localization's public extensions to the generated localization file's prologue, enabling users to access translation utilities through a single import rather than two separate imports.

Changes

Cohort / File(s) Summary
Generator Export Enhancement
bin/generate.dart
Added export directive export 'package:easy_localization/src/public_ext.dart'; to the generated file's prologue to re-export public extensions without modifying generation logic or key resolution behavior.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 A hop, a skip, one line of cheer,
Export the extensions, crystal clear!
No more double imports to frustrate,
One bundle now—how truly first-rate! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Re-export public_ext from generated LocaleKeys file' accurately summarizes the main change: adding an export directive for public_ext to the generated locale keys file.
Linked Issues check ✅ Passed The PR successfully implements the requirement from issue #780 by adding the export statement 'export 'package:easy_localization/src/public_ext.dart';' to the generated file header.
Out of Scope Changes check ✅ Passed All changes are directly related to the linked issue #780 requirement; only the generator was modified to add the requested export directive with no extraneous modifications.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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
Review rate limit: 7/8 reviews remaining, refill in 7 minutes and 30 seconds.

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

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 an export statement for the public extensions in the LocaleKeys class

1 participant