Skip to content

Commit

Permalink
lightbox: Translations
Browse files Browse the repository at this point in the history
  • Loading branch information
sirpengi committed Oct 2, 2023
1 parent 49d6f99 commit 4360fa4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
8 changes: 8 additions & 0 deletions assets/l10n/app_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@
"@errorQuotationFailed": {
"description": "Error message when quoting a message failed."
},
"successLinkCopied": "Link copied",
"@successLinkCopied": {
"description": "Success message after copy link action completed."
},
"successMessageCopied": "Message Copied",
"@successMessageCopied": {
"description": "Message when content of a message was copied to the users system clipboard."
Expand All @@ -83,6 +87,10 @@
"@errorDialogContinue": {
"description": "Button label in error dialogs to acknowledge error."
},
"lightboxCopyLinkTooltip": "Copy link",
"@lightboxCopyLinkTooltip": {
"description": "Tooltip in lightbox for the copy link action."
},
"subscribedToNStreams": "Subscribed to {num, plural, =0{no streams} =1{1 stream} other{{num} streams}}",
"@subscribedToNStreams": {
"description": "Test page label showing number of streams user is subscribed to.",
Expand Down
10 changes: 6 additions & 4 deletions lib/widgets/lightbox.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_gen/gen_l10n/zulip_localizations.dart';
import 'package:intl/intl.dart';

import '../api/model/model.dart';
Expand Down Expand Up @@ -70,12 +71,13 @@ class _CopyLinkButton extends StatelessWidget {

@override
Widget build(BuildContext context) {
final zulipLocalizations = ZulipLocalizations.of(context);
return IconButton(
tooltip: 'Copy link',
tooltip: zulipLocalizations.lightboxCopyLinkTooltip,
icon: const Icon(Icons.copy),
onPressed: () async {
// TODO(i18n)
copyWithPopup(context: context, successContent: const Text('Link copied'),
copyWithPopup(context: context,
successContent: Text(zulipLocalizations.successLinkCopied),
data: ClipboardData(text: url.toString()));
});
}
Expand Down Expand Up @@ -136,7 +138,7 @@ class _LightboxPageState extends State<_LightboxPage> {
if (_headerFooterVisible) {
// TODO(#45): Format with e.g. "Yesterday at 4:47 PM"
final timestampText = DateFormat
.yMMMd(/* TODO(i18n): Pass selected language here, I think? */)
.yMMMd(/* TODO(#278): Pass selected language here, I think? */)
.add_Hms()
.format(DateTime.fromMillisecondsSinceEpoch(widget.message.timestamp * 1000));

Expand Down

0 comments on commit 4360fa4

Please sign in to comment.