@@ -360,12 +360,14 @@ class _StreamContentInputState extends State<_StreamContentInput> {
360
360
@override
361
361
Widget build (BuildContext context) {
362
362
final store = PerAccountStoreWidget .of (context);
363
- final streamName = store.streams[widget.narrow.streamId]? .name ?? '(unknown stream)' ;
363
+ final zulipLocalizations = ZulipLocalizations .of (context);
364
+ final streamName = store.streams[widget.narrow.streamId]? .name
365
+ ?? zulipLocalizations.composeBoxUnknownStreamName;
364
366
return _ContentInput (
365
367
narrow: widget.narrow,
366
368
controller: widget.controller,
367
369
focusNode: widget.focusNode,
368
- hintText: "Message #$ streamName > $ _topicTextNormalized " );
370
+ hintText: zulipLocalizations. composeBoxStreamContentHint ( streamName, _topicTextNormalized) );
369
371
}
370
372
}
371
373
@@ -381,23 +383,25 @@ class _FixedDestinationContentInput extends StatelessWidget {
381
383
final FocusNode focusNode;
382
384
383
385
String _hintText (BuildContext context) {
386
+ final zulipLocalizations = ZulipLocalizations .of (context);
384
387
switch (narrow) {
385
388
case TopicNarrow (: final streamId, : final topic):
386
389
final store = PerAccountStoreWidget .of (context);
387
- final streamName = store.streams[streamId]? .name ?? '(unknown stream)' ;
388
- return "Message #$streamName > $topic " ;
390
+ final streamName = store.streams[streamId]? .name
391
+ ?? zulipLocalizations.composeBoxUnknownStreamName;
392
+ return zulipLocalizations.composeBoxStreamContentHint (streamName, topic);
389
393
390
394
case DmNarrow (otherRecipientIds: []): // The self-1:1 thread.
391
- return "Jot down something" ;
395
+ return zulipLocalizations.composeBoxSelfDmContentHint ;
392
396
393
397
case DmNarrow (otherRecipientIds: [final otherUserId]):
394
398
final store = PerAccountStoreWidget .of (context);
395
399
final fullName = store.users[otherUserId]? .fullName;
396
- if (fullName == null ) return 'Type a message' ;
397
- return 'Message @$ fullName ' ;
400
+ if (fullName == null ) return zulipLocalizations.composeBoxGenericContentHint ;
401
+ return zulipLocalizations. composeBoxDmContentHint ( fullName) ;
398
402
399
403
case DmNarrow (): // A group DM thread.
400
- return 'Message group' ;
404
+ return zulipLocalizations.composeBoxGroupDmContentHint ;
401
405
}
402
406
}
403
407
@@ -493,7 +497,7 @@ abstract class _AttachUploadsButton extends StatelessWidget {
493
497
final FocusNode contentFocusNode;
494
498
495
499
IconData get icon;
496
- String get tooltip;
500
+ String tooltip ( ZulipLocalizations zulipLocalizations) ;
497
501
498
502
/// Request files from the user, in the way specific to this upload type.
499
503
///
@@ -525,9 +529,10 @@ abstract class _AttachUploadsButton extends StatelessWidget {
525
529
526
530
@override
527
531
Widget build (BuildContext context) {
532
+ final zulipLocalizations = ZulipLocalizations .of (context);
528
533
return IconButton (
529
534
icon: Icon (icon),
530
- tooltip: tooltip,
535
+ tooltip: tooltip (zulipLocalizations) ,
531
536
onPressed: () => _handlePress (context));
532
537
}
533
538
}
@@ -576,8 +581,10 @@ class _AttachFileButton extends _AttachUploadsButton {
576
581
577
582
@override
578
583
IconData get icon => Icons .attach_file;
584
+
579
585
@override
580
- String get tooltip => 'Attach files' ;
586
+ String tooltip (ZulipLocalizations zulipLocalizations) =>
587
+ zulipLocalizations.composeBoxAttachFilesTooltip;
581
588
582
589
@override
583
590
Future <Iterable <_File >> getFiles (BuildContext context) async {
@@ -590,8 +597,10 @@ class _AttachMediaButton extends _AttachUploadsButton {
590
597
591
598
@override
592
599
IconData get icon => Icons .image;
600
+
593
601
@override
594
- String get tooltip => 'Attach images or videos' ;
602
+ String tooltip (ZulipLocalizations zulipLocalizations) =>
603
+ zulipLocalizations.composeBoxAttachMediaTooltip;
595
604
596
605
@override
597
606
Future <Iterable <_File >> getFiles (BuildContext context) async {
@@ -605,8 +614,10 @@ class _AttachFromCameraButton extends _AttachUploadsButton {
605
614
606
615
@override
607
616
IconData get icon => Icons .camera_alt;
617
+
608
618
@override
609
- String get tooltip => 'Take a photo' ;
619
+ String tooltip (ZulipLocalizations zulipLocalizations) =>
620
+ zulipLocalizations.composeBoxAttachFromCameraTooltip;
610
621
611
622
@override
612
623
Future <Iterable <_File >> getFiles (BuildContext context) async {
@@ -731,6 +742,7 @@ class _SendButtonState extends State<_SendButton> {
731
742
Widget build (BuildContext context) {
732
743
final disabled = _hasValidationErrors;
733
744
final colorScheme = Theme .of (context).colorScheme;
745
+ final zulipLocalizations = ZulipLocalizations .of (context);
734
746
735
747
// Copy FilledButton defaults (_FilledButtonDefaultsM3.backgroundColor)
736
748
final backgroundColor = disabled
@@ -748,7 +760,7 @@ class _SendButtonState extends State<_SendButton> {
748
760
color: backgroundColor,
749
761
),
750
762
child: IconButton (
751
- tooltip: 'Send' ,
763
+ tooltip: zulipLocalizations.composeBoxSendTooltip ,
752
764
753
765
// Match the height of the content input. Zeroing the padding lets the
754
766
// constraints take over.
@@ -866,14 +878,15 @@ class _StreamComposeBoxState extends State<_StreamComposeBox> implements Compose
866
878
@override
867
879
Widget build (BuildContext context) {
868
880
final colorScheme = Theme .of (context).colorScheme;
881
+ final zulipLocalizations = ZulipLocalizations .of (context);
869
882
870
883
return _ComposeBoxLayout (
871
884
contentController: _contentController,
872
885
contentFocusNode: _contentFocusNode,
873
886
topicInput: TextField (
874
887
controller: _topicController,
875
888
style: TextStyle (color: colorScheme.onSurface),
876
- decoration: const InputDecoration (hintText: 'Topic' ),
889
+ decoration: InputDecoration (hintText: zulipLocalizations.composeBoxTopicHintText ),
877
890
),
878
891
contentInput: _StreamContentInput (
879
892
narrow: widget.narrow,
0 commit comments