Skip to content

Commit

Permalink
compose: Avoid translating Zulip message destinations
Browse files Browse the repository at this point in the history
The '#channel > topic' style strings are not supposed to be translated
into different languages as they are Zulip's language of expressing the
desintation, not something bound to the English language.

See also:
  zulip#1148 (comment)

Signed-off-by: Zixuan James Li <zixuan@zulip.com>
  • Loading branch information
PIG208 committed Feb 21, 2025
1 parent 3523bc0 commit 3b247e6
Show file tree
Hide file tree
Showing 12 changed files with 22 additions and 51 deletions.
7 changes: 3 additions & 4 deletions assets/l10n/app_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -348,12 +348,11 @@
"@composeBoxSelfDmContentHint": {
"description": "Hint text for content input when sending a message to yourself."
},
"composeBoxChannelContentHint": "Message #{channel} > {topic}",
"composeBoxChannelContentHint": "Message {destination}",
"@composeBoxChannelContentHint": {
"description": "Hint text for content input when sending a message to a channel",
"description": "Hint text for content input when sending a message to a channel.",
"placeholders": {
"channel": {"type": "String", "example": "channel name"},
"topic": {"type": "String", "example": "topic name"}
"destination": {"type": "String", "example": "#channel name > topic name"}
}
},
"composeBoxSendTooltip": "Send",
Expand Down
14 changes: 0 additions & 14 deletions assets/l10n/app_pl.arb
Original file line number Diff line number Diff line change
Expand Up @@ -263,20 +263,6 @@
"@composeBoxSelfDmContentHint": {
"description": "Hint text for content input when sending a message to yourself."
},
"composeBoxChannelContentHint": "Wiadomość #{channel} > {topic}",
"@composeBoxChannelContentHint": {
"description": "Hint text for content input when sending a message to a channel",
"placeholders": {
"channel": {
"type": "String",
"example": "channel name"
},
"topic": {
"type": "String",
"example": "topic name"
}
}
},
"composeBoxTopicHintText": "Wątek",
"@composeBoxTopicHintText": {
"description": "Hint text for topic input widget in compose box."
Expand Down
14 changes: 0 additions & 14 deletions assets/l10n/app_ru.arb
Original file line number Diff line number Diff line change
Expand Up @@ -373,20 +373,6 @@
"@composeBoxGenericContentHint": {
"description": "Hint text for content input when sending a message."
},
"composeBoxChannelContentHint": "Сообщение для #{channel} > {topic}",
"@composeBoxChannelContentHint": {
"description": "Hint text for content input when sending a message to a channel",
"placeholders": {
"channel": {
"type": "String",
"example": "channel name"
},
"topic": {
"type": "String",
"example": "topic name"
}
}
},
"composeBoxSendTooltip": "Отправить",
"@composeBoxSendTooltip": {
"description": "Tooltip for send button in compose box."
Expand Down
6 changes: 3 additions & 3 deletions lib/generated/l10n/zulip_localizations.dart
Original file line number Diff line number Diff line change
Expand Up @@ -567,11 +567,11 @@ abstract class ZulipLocalizations {
/// **'Jot down something'**
String get composeBoxSelfDmContentHint;

/// Hint text for content input when sending a message to a channel
/// Hint text for content input when sending a message to a channel.
///
/// In en, this message translates to:
/// **'Message #{channel} > {topic}'**
String composeBoxChannelContentHint(String channel, String topic);
/// **'Message {destination}'**
String composeBoxChannelContentHint(String destination);

/// Tooltip for send button in compose box.
///
Expand Down
4 changes: 2 additions & 2 deletions lib/generated/l10n/zulip_localizations_ar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -276,8 +276,8 @@ class ZulipLocalizationsAr extends ZulipLocalizations {
String get composeBoxSelfDmContentHint => 'Jot down something';

@override
String composeBoxChannelContentHint(String channel, String topic) {
return 'Message #$channel > $topic';
String composeBoxChannelContentHint(String destination) {
return 'Message $destination';
}

@override
Expand Down
4 changes: 2 additions & 2 deletions lib/generated/l10n/zulip_localizations_en.dart
Original file line number Diff line number Diff line change
Expand Up @@ -276,8 +276,8 @@ class ZulipLocalizationsEn extends ZulipLocalizations {
String get composeBoxSelfDmContentHint => 'Jot down something';

@override
String composeBoxChannelContentHint(String channel, String topic) {
return 'Message #$channel > $topic';
String composeBoxChannelContentHint(String destination) {
return 'Message $destination';
}

@override
Expand Down
4 changes: 2 additions & 2 deletions lib/generated/l10n/zulip_localizations_ja.dart
Original file line number Diff line number Diff line change
Expand Up @@ -276,8 +276,8 @@ class ZulipLocalizationsJa extends ZulipLocalizations {
String get composeBoxSelfDmContentHint => 'Jot down something';

@override
String composeBoxChannelContentHint(String channel, String topic) {
return 'Message #$channel > $topic';
String composeBoxChannelContentHint(String destination) {
return 'Message $destination';
}

@override
Expand Down
4 changes: 2 additions & 2 deletions lib/generated/l10n/zulip_localizations_nb.dart
Original file line number Diff line number Diff line change
Expand Up @@ -276,8 +276,8 @@ class ZulipLocalizationsNb extends ZulipLocalizations {
String get composeBoxSelfDmContentHint => 'Jot down something';

@override
String composeBoxChannelContentHint(String channel, String topic) {
return 'Message #$channel > $topic';
String composeBoxChannelContentHint(String destination) {
return 'Message $destination';
}

@override
Expand Down
4 changes: 2 additions & 2 deletions lib/generated/l10n/zulip_localizations_pl.dart
Original file line number Diff line number Diff line change
Expand Up @@ -276,8 +276,8 @@ class ZulipLocalizationsPl extends ZulipLocalizations {
String get composeBoxSelfDmContentHint => 'Zanotuj coś na przyszłość';

@override
String composeBoxChannelContentHint(String channel, String topic) {
return 'Wiadomość #$channel > $topic';
String composeBoxChannelContentHint(String destination) {
return 'Message $destination';
}

@override
Expand Down
4 changes: 2 additions & 2 deletions lib/generated/l10n/zulip_localizations_ru.dart
Original file line number Diff line number Diff line change
Expand Up @@ -276,8 +276,8 @@ class ZulipLocalizationsRu extends ZulipLocalizations {
String get composeBoxSelfDmContentHint => 'Сделать заметку';

@override
String composeBoxChannelContentHint(String channel, String topic) {
return 'Сообщение для #$channel > $topic';
String composeBoxChannelContentHint(String destination) {
return 'Message $destination';
}

@override
Expand Down
4 changes: 2 additions & 2 deletions lib/generated/l10n/zulip_localizations_sk.dart
Original file line number Diff line number Diff line change
Expand Up @@ -276,8 +276,8 @@ class ZulipLocalizationsSk extends ZulipLocalizations {
String get composeBoxSelfDmContentHint => 'Jot down something';

@override
String composeBoxChannelContentHint(String channel, String topic) {
return 'Message #$channel > $topic';
String composeBoxChannelContentHint(String destination) {
return 'Message $destination';
}

@override
Expand Down
4 changes: 2 additions & 2 deletions lib/widgets/compose_box.dart
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,7 @@ class _StreamContentInputState extends State<_StreamContentInput> {
destination: TopicNarrow(widget.narrow.streamId, topic),
controller: widget.controller,
hintText: zulipLocalizations.composeBoxChannelContentHint(
streamName, topic.displayName));
'#$streamName > ${topic.displayName}'));
}
}

Expand Down Expand Up @@ -649,7 +649,7 @@ class _FixedDestinationContentInput extends StatelessWidget {
final streamName = store.streams[streamId]?.name
?? zulipLocalizations.unknownChannelName;
return zulipLocalizations.composeBoxChannelContentHint(
streamName, topic.displayName);
'#$streamName > ${topic.displayName}');

case DmNarrow(otherRecipientIds: []): // The self-1:1 thread.
return zulipLocalizations.composeBoxSelfDmContentHint;
Expand Down

0 comments on commit 3b247e6

Please sign in to comment.