-
Notifications
You must be signed in to change notification settings - Fork 37
Fix: Replace hardcoded strings with AppLocalizations keys #321
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -22,7 +22,6 @@ import 'package:magicepaperapp/l10n/app_localizations.dart'; | |||||
| import '../util/app_logger.dart'; | ||||||
| import 'package:magicepaperapp/provider/getitlocator.dart'; | ||||||
|
|
||||||
| AppLocalizations appLocalizations = getIt.get<AppLocalizations>(); | ||||||
|
|
||||||
| class ImageEditor extends StatefulWidget { | ||||||
| final DisplayDevice device; | ||||||
|
|
@@ -311,7 +310,7 @@ class _ImageEditorState extends State<ImageEditor> { | |||||
| style: TextButton.styleFrom( | ||||||
| foregroundColor: colorAccent, | ||||||
| ), | ||||||
| child: const Text('OK'), | ||||||
| child: Text(appLocalizations.ok), | ||||||
| ), | ||||||
| ], | ||||||
| ); | ||||||
|
|
@@ -321,6 +320,7 @@ class _ImageEditorState extends State<ImageEditor> { | |||||
|
|
||||||
| @override | ||||||
| Widget build(BuildContext context) { | ||||||
| final appLocalizations = AppLocalizations.of(context)!; | ||||||
| var imgLoader = context.watch<ImageLoader>(); | ||||||
|
Comment on lines
321
to
324
|
||||||
| if (!_isInitializing && imgLoader.image != null && !_isProcessingImages) { | ||||||
| WidgetsBinding.instance.addPostFrameCallback((_) { | ||||||
|
|
@@ -578,6 +578,7 @@ class BottomActionMenu extends StatelessWidget { | |||||
|
|
||||||
| @override | ||||||
| Widget build(BuildContext context) { | ||||||
| final appLocalizations = AppLocalizations.of(context)!; | ||||||
| return SafeArea( | ||||||
|
Comment on lines
+581
to
582
|
||||||
| top: false, | ||||||
| bottom: true, | ||||||
|
|
@@ -602,7 +603,7 @@ class BottomActionMenu extends StatelessWidget { | |||||
| _buildActionButton( | ||||||
| context: context, | ||||||
| icon: Icons.add_photo_alternate_outlined, | ||||||
| label: "Import", | ||||||
| label: appLocalizations.import, | ||||||
|
||||||
| label: appLocalizations.import, | |
| label: appLocalizations.importImageButtonLabel, |
Copilot
AI
Feb 9, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
appLocalizations.text does not exist in the generated AppLocalizations API, so this will not compile. Please switch to the correct existing localization key for this action label (or add it to the ARB files and regenerate).
| label: appLocalizations.text, | |
| label: 'Text', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getitlocator.dartis now unused in this file after removinggetIt.get<AppLocalizations>(). Please remove the unused import to keepflutter analyzeclean.