Skip to content

Fix: localize text editor title#349

Open
Aryan-Singla wants to merge 5 commits intofossasia:mainfrom
Aryan-Singla:fix/localize-text-editor-title
Open

Fix: localize text editor title#349
Aryan-Singla wants to merge 5 commits intofossasia:mainfrom
Aryan-Singla:fix/localize-text-editor-title

Conversation

@Aryan-Singla
Copy link
Copy Markdown

For Issue:
Fixes #348

Description:

Context:
While working on the application, I identified that the TextFitEditor screen was using a hardcoded string ('Text Editor') for its AppBar title. This prevents the screen from being properly localized into other languages supported by the app.

Changes Made:

  • Localization: Defined the textEditorTitle key in lib/l10n/app_en.arb to manage the UI string centrally.
  • Code Refactoring: Updated lib/view/text_fit_editor.dart to fetch the AppBar title dynamically via AppLocalizations.of(context)!.textEditorTitle, removing the hardcoded value.
  • Unit/Widget Testing:
    • Created a new test file: test/text_editor_localization_test.dart.
    • Implemented a widget test to verify that the AppBar title is correctly rendered from the localization system.
    • Configured the test environment to handle GetIt service locator and ColorPaletteProvider dependencies.

Impact:

  • i18n Support: The app's header in the Text Editor section is now fully translatable.
  • Reliability: The added widget test ensures that future changes won't break the localization or the UI initialization for this screen

Testing Verification:
Successfully verified the fix by running: flutter test test/text_editor_localization_test.dart

Result:
All tests passed!

Evidence:

image

Copy link
Copy Markdown
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Sorry @Aryan-Singla, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

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.

[BUG] - Hardcoded AppBar title in TextFitEditor prevents proper localization

1 participant