-
Notifications
You must be signed in to change notification settings - Fork 17
Description
Description
Several SnackBar messages in the codebase use hardcoded English strings instead of localized strings from the ARB files. These should be internationalized to support the existing Spanish and Italian translations.
Context
This issue was identified during the review of PR #413 (moving SnackBars to top). While that PR focused on SnackBar positioning, it revealed pre-existing hardcoded text that should be localized.
Files and strings requiring internationalization
lib/features/chat/widgets/encrypted_file_message.dart
Lines 498-509:
'Could not open file: ${result.message}''Error opening file: $e'
Suggested keys:
couldNotOpenFilewith parameter for result.messageerrorOpeningFilewith parameter for error
lib/features/chat/widgets/message_input.dart
Line 131:
'Error uploading file: $e'
Suggested keys:
errorUploadingFilewith parameter for error- Consider logging raw exception to console/logs instead of showing to user
lib/features/disputes/widgets/dispute_input_section.dart
Lines 131, 139:
'Message sent: $message''Failed to send message: $error'
Suggested keys:
messageSentwith parameter for message contentfailedToSendMessagewith parameter for error
lib/features/disputes/widgets/dispute_message_bubble.dart
Line 92:
- Uses nullable access
S.of(context)?.messageCopiedToClipboardwith fallback'Message copied to clipboard'
Action needed:
- Change to non-nullable:
S.of(context)!.messageCopiedToClipboard - Remove the
?? 'Message copied to clipboard'fallback
lib/features/order/screens/add_lightning_invoice_screen.dart
Line 84:
'Failed to cancel order: ${e.toString()}'
Suggested keys:
failedToCancelOrderwith parameter for error message
lib/shared/widgets/clickable_text_widget.dart
Line 39:
'${widget.leftText} ${widget.clickableText} copied to clipboard'
Suggested keys:
textCopiedToClipboardwith parameters for the concatenated text, or- A more generic
copiedToClipboardmessage
lib/shared/widgets/exchange_rate_widget.dart
Line 49:
'Refreshing exchange rate...'
Suggested keys:
refreshingExchangeRate
Implementation checklist
- Add new keys to
lib/l10n/intl_en.arbwith English text - Add corresponding translations to
lib/l10n/intl_es.arb(Spanish) - Add corresponding translations to
lib/l10n/intl_it.arb(Italian) - Update each file to use
S.of(context)!.<key>instead of hardcoded strings - For messages with dynamic content (errors, file names), use parameterized localization keys
- Consider logging technical error details separately from user-facing messages
Notes
Several files in PR #413 already use proper localization (e.g., add_order_screen.dart, trade_detail_screen.dart, message_bubble.dart), so follow those patterns.
Related
- PR Move SnackBars to top to avoid blocking bottom navigation #413: Move SnackBars to top to avoid blocking bottom navigation #413
- Issue Replace bottom snackbar with top snackBar #397: Replace bottom snackbar with top snackBar #397
cc @Catrya