Skip to content

Commit 9e9db9b

Browse files
committed
Sweep for non-localized '(unknown channel)' strings
Renamed the label to generalize it Signed-off-by: Zixuan James Li <[email protected]>
1 parent d809507 commit 9e9db9b

11 files changed

+63
-15
lines changed

assets/l10n/app_en.arb

+10-2
Original file line numberDiff line numberDiff line change
@@ -325,8 +325,8 @@
325325
"@composeBoxSendTooltip": {
326326
"description": "Tooltip for send button in compose box."
327327
},
328-
"composeBoxUnknownChannelName": "(unknown channel)",
329-
"@composeBoxUnknownChannelName": {
328+
"unknownChannelName": "(unknown channel)",
329+
"@unknownChannelName": {
330330
"description": "Replacement name for channel when it cannot be found in the store."
331331
},
332332
"composeBoxTopicHintText": "Topic",
@@ -618,6 +618,14 @@
618618
"@channelFeedButtonTooltip": {
619619
"description": "Tooltip for button to navigate to a given channel's feed"
620620
},
621+
"notifChannelConversationLabel": "#{channel} > {topic}",
622+
"@notifChannelConversationLabel": {
623+
"description": "Label for a channel conversation notification.",
624+
"placeholders": {
625+
"channel": {"type": "String", "example": "channel name"},
626+
"topic": {"type": "String", "example": "topic name"}
627+
}
628+
},
621629
"notifGroupDmConversationLabel": "{senderFullName} to you and {numOthers, plural, =1{1 other} other{{numOthers} others}}",
622630
"@notifGroupDmConversationLabel": {
623631
"description": "Label for a group DM conversation notification.",

lib/generated/l10n/zulip_localizations.dart

+7-1
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,7 @@ abstract class ZulipLocalizations {
539539
///
540540
/// In en, this message translates to:
541541
/// **'(unknown channel)'**
542-
String get composeBoxUnknownChannelName;
542+
String get unknownChannelName;
543543

544544
/// Hint text for topic input widget in compose box.
545545
///
@@ -937,6 +937,12 @@ abstract class ZulipLocalizations {
937937
/// **'Channel feed'**
938938
String get channelFeedButtonTooltip;
939939

940+
/// Label for a channel conversation notification.
941+
///
942+
/// In en, this message translates to:
943+
/// **'#{channel} > {topic}'**
944+
String notifChannelConversationLabel(String channel, String topic);
945+
940946
/// Label for a group DM conversation notification.
941947
///
942948
/// In en, this message translates to:

lib/generated/l10n/zulip_localizations_ar.dart

+6-1
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ class ZulipLocalizationsAr extends ZulipLocalizations {
259259
String get composeBoxSendTooltip => 'Send';
260260

261261
@override
262-
String get composeBoxUnknownChannelName => '(unknown channel)';
262+
String get unknownChannelName => '(unknown channel)';
263263

264264
@override
265265
String get composeBoxTopicHintText => 'Topic';
@@ -487,6 +487,11 @@ class ZulipLocalizationsAr extends ZulipLocalizations {
487487
@override
488488
String get channelFeedButtonTooltip => 'Channel feed';
489489

490+
@override
491+
String notifChannelConversationLabel(String channel, String topic) {
492+
return '#$channel > $topic';
493+
}
494+
490495
@override
491496
String notifGroupDmConversationLabel(String senderFullName, int numOthers) {
492497
String _temp0 = intl.Intl.pluralLogic(

lib/generated/l10n/zulip_localizations_en.dart

+6-1
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ class ZulipLocalizationsEn extends ZulipLocalizations {
259259
String get composeBoxSendTooltip => 'Send';
260260

261261
@override
262-
String get composeBoxUnknownChannelName => '(unknown channel)';
262+
String get unknownChannelName => '(unknown channel)';
263263

264264
@override
265265
String get composeBoxTopicHintText => 'Topic';
@@ -487,6 +487,11 @@ class ZulipLocalizationsEn extends ZulipLocalizations {
487487
@override
488488
String get channelFeedButtonTooltip => 'Channel feed';
489489

490+
@override
491+
String notifChannelConversationLabel(String channel, String topic) {
492+
return '#$channel > $topic';
493+
}
494+
490495
@override
491496
String notifGroupDmConversationLabel(String senderFullName, int numOthers) {
492497
String _temp0 = intl.Intl.pluralLogic(

lib/generated/l10n/zulip_localizations_fr.dart

+6-1
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ class ZulipLocalizationsFr extends ZulipLocalizations {
259259
String get composeBoxSendTooltip => 'Send';
260260

261261
@override
262-
String get composeBoxUnknownChannelName => '(unknown channel)';
262+
String get unknownChannelName => '(unknown channel)';
263263

264264
@override
265265
String get composeBoxTopicHintText => 'Topic';
@@ -487,6 +487,11 @@ class ZulipLocalizationsFr extends ZulipLocalizations {
487487
@override
488488
String get channelFeedButtonTooltip => 'Channel feed';
489489

490+
@override
491+
String notifChannelConversationLabel(String channel, String topic) {
492+
return '#$channel > $topic';
493+
}
494+
490495
@override
491496
String notifGroupDmConversationLabel(String senderFullName, int numOthers) {
492497
String _temp0 = intl.Intl.pluralLogic(

lib/generated/l10n/zulip_localizations_ja.dart

+6-1
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ class ZulipLocalizationsJa extends ZulipLocalizations {
259259
String get composeBoxSendTooltip => 'Send';
260260

261261
@override
262-
String get composeBoxUnknownChannelName => '(unknown channel)';
262+
String get unknownChannelName => '(unknown channel)';
263263

264264
@override
265265
String get composeBoxTopicHintText => 'Topic';
@@ -487,6 +487,11 @@ class ZulipLocalizationsJa extends ZulipLocalizations {
487487
@override
488488
String get channelFeedButtonTooltip => 'Channel feed';
489489

490+
@override
491+
String notifChannelConversationLabel(String channel, String topic) {
492+
return '#$channel > $topic';
493+
}
494+
490495
@override
491496
String notifGroupDmConversationLabel(String senderFullName, int numOthers) {
492497
String _temp0 = intl.Intl.pluralLogic(

lib/generated/l10n/zulip_localizations_pl.dart

+6-1
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ class ZulipLocalizationsPl extends ZulipLocalizations {
259259
String get composeBoxSendTooltip => 'Wyślij';
260260

261261
@override
262-
String get composeBoxUnknownChannelName => '(nieznany kanał)';
262+
String get unknownChannelName => '(unknown channel)';
263263

264264
@override
265265
String get composeBoxTopicHintText => 'Wątek';
@@ -487,6 +487,11 @@ class ZulipLocalizationsPl extends ZulipLocalizations {
487487
@override
488488
String get channelFeedButtonTooltip => 'Strumień kanału';
489489

490+
@override
491+
String notifChannelConversationLabel(String channel, String topic) {
492+
return '#$channel > $topic';
493+
}
494+
490495
@override
491496
String notifGroupDmConversationLabel(String senderFullName, int numOthers) {
492497
String _temp0 = intl.Intl.pluralLogic(

lib/generated/l10n/zulip_localizations_ru.dart

+6-1
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ class ZulipLocalizationsRu extends ZulipLocalizations {
259259
String get composeBoxSendTooltip => 'Send';
260260

261261
@override
262-
String get composeBoxUnknownChannelName => '(unknown channel)';
262+
String get unknownChannelName => '(unknown channel)';
263263

264264
@override
265265
String get composeBoxTopicHintText => 'Topic';
@@ -487,6 +487,11 @@ class ZulipLocalizationsRu extends ZulipLocalizations {
487487
@override
488488
String get channelFeedButtonTooltip => 'Channel feed';
489489

490+
@override
491+
String notifChannelConversationLabel(String channel, String topic) {
492+
return '#$channel > $topic';
493+
}
494+
490495
@override
491496
String notifGroupDmConversationLabel(String senderFullName, int numOthers) {
492497
String _temp0 = intl.Intl.pluralLogic(

lib/notifications/display.dart

+3-2
Original file line numberDiff line numberDiff line change
@@ -263,9 +263,10 @@ class NotificationDisplayManager {
263263
// the first.
264264
messagingStyle.conversationTitle = switch (data.recipient) {
265265
FcmMessageChannelRecipient(:var streamName?, :var topic) =>
266-
'#$streamName > $topic',
266+
zulipLocalizations.notifChannelConversationLabel(streamName, topic),
267267
FcmMessageChannelRecipient(:var topic) =>
268-
'#(unknown channel) > $topic', // TODO get stream name from data
268+
zulipLocalizations.notifChannelConversationLabel(
269+
zulipLocalizations.unknownChannelName, topic), // TODO get stream name from data
269270
FcmMessageDmRecipient(:var allRecipientIds) when allRecipientIds.length > 2 =>
270271
zulipLocalizations.notifGroupDmConversationLabel(
271272
data.senderFullName, allRecipientIds.length - 2), // TODO use others' names, from data

lib/widgets/compose_box.dart

+2-2
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,7 @@ class _StreamContentInputState extends State<_StreamContentInput> {
483483
final store = PerAccountStoreWidget.of(context);
484484
final zulipLocalizations = ZulipLocalizations.of(context);
485485
final streamName = store.streams[widget.narrow.streamId]?.name
486-
?? zulipLocalizations.composeBoxUnknownChannelName;
486+
?? zulipLocalizations.unknownChannelName;
487487
return _ContentInput(
488488
narrow: widget.narrow,
489489
destination: TopicNarrow(widget.narrow.streamId, _topicTextNormalized),
@@ -545,7 +545,7 @@ class _FixedDestinationContentInput extends StatelessWidget {
545545
case TopicNarrow(:final streamId, :final topic):
546546
final store = PerAccountStoreWidget.of(context);
547547
final streamName = store.streams[streamId]?.name
548-
?? zulipLocalizations.composeBoxUnknownChannelName;
548+
?? zulipLocalizations.unknownChannelName;
549549
return zulipLocalizations.composeBoxChannelContentHint(streamName, topic);
550550

551551
case DmNarrow(otherRecipientIds: []): // The self-1:1 thread.

lib/widgets/message_list.dart

+5-2
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,7 @@ class MessageListAppBarTitle extends StatelessWidget {
317317
Widget _buildStreamRow(BuildContext context, {
318318
ZulipStream? stream,
319319
}) {
320+
final zulipLocalizations = ZulipLocalizations.of(context);
320321
// A null [Icon.icon] makes a blank space.
321322
final icon = stream != null ? iconDataForStream(stream) : null;
322323
return Row(
@@ -328,7 +329,8 @@ class MessageListAppBarTitle extends StatelessWidget {
328329
children: [
329330
Icon(size: 16, icon),
330331
const SizedBox(width: 4),
331-
Flexible(child: Text(stream?.name ?? '(unknown channel)')),
332+
Flexible(child: Text(
333+
stream?.name ?? zulipLocalizations.unknownChannelName)),
332334
]);
333335
}
334336

@@ -1028,6 +1030,7 @@ class StreamMessageRecipientHeader extends StatelessWidget {
10281030
// https://github.com/zulip/zulip-mobile/issues/5511
10291031
final store = PerAccountStoreWidget.of(context);
10301032
final designVariables = DesignVariables.of(context);
1033+
final zulipLocalizations = ZulipLocalizations.of(context);
10311034

10321035
final topic = message.topic;
10331036

@@ -1052,7 +1055,7 @@ class StreamMessageRecipientHeader extends StatelessWidget {
10521055
final stream = store.streams[message.streamId];
10531056
final streamName = stream?.name
10541057
?? message.displayRecipient
1055-
?? '(unknown channel)'; // TODO(log)
1058+
?? zulipLocalizations.unknownChannelName; // TODO(log)
10561059

10571060
streamWidget = GestureDetector(
10581061
onTap: () => Navigator.push(context,

0 commit comments

Comments
 (0)