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:
couldNotOpenFile with parameter for result.message
errorOpeningFile with parameter for error
lib/features/chat/widgets/message_input.dart
Line 131:
'Error uploading file: $e'
Suggested keys:
errorUploadingFile with 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:
messageSent with parameter for message content
failedToSendMessage with parameter for error
lib/features/disputes/widgets/dispute_message_bubble.dart
Line 92:
- Uses nullable access
S.of(context)?.messageCopiedToClipboard with 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:
failedToCancelOrder with parameter for error message
lib/shared/widgets/clickable_text_widget.dart
Line 39:
'${widget.leftText} ${widget.clickableText} copied to clipboard'
Suggested keys:
textCopiedToClipboard with parameters for the concatenated text, or
- A more generic
copiedToClipboard message
lib/shared/widgets/exchange_rate_widget.dart
Line 49:
'Refreshing exchange rate...'
Suggested keys:
Implementation checklist
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
cc @Catrya
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 errorlib/features/chat/widgets/message_input.dart
Line 131:
'Error uploading file: $e'Suggested keys:
errorUploadingFilewith parameter for errorlib/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 errorlib/features/disputes/widgets/dispute_message_bubble.dart
Line 92:
S.of(context)?.messageCopiedToClipboardwith fallback'Message copied to clipboard'Action needed:
S.of(context)!.messageCopiedToClipboard?? 'Message copied to clipboard'fallbacklib/features/order/screens/add_lightning_invoice_screen.dart
Line 84:
'Failed to cancel order: ${e.toString()}'Suggested keys:
failedToCancelOrderwith parameter for error messagelib/shared/widgets/clickable_text_widget.dart
Line 39:
'${widget.leftText} ${widget.clickableText} copied to clipboard'Suggested keys:
textCopiedToClipboardwith parameters for the concatenated text, orcopiedToClipboardmessagelib/shared/widgets/exchange_rate_widget.dart
Line 49:
'Refreshing exchange rate...'Suggested keys:
refreshingExchangeRateImplementation checklist
lib/l10n/intl_en.arbwith English textlib/l10n/intl_es.arb(Spanish)lib/l10n/intl_it.arb(Italian)S.of(context)!.<key>instead of hardcoded stringsNotes
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
cc @Catrya