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.

The string needs to be re-translated in other languages, as the
placeholder is now different.

See also:
  zulip#1148 (comment)

Signed-off-by: Zixuan James Li <[email protected]>
  • Loading branch information
PIG208 committed Feb 8, 2025
1 parent 67c8c13 commit 22c2148
Show file tree
Hide file tree
Showing 12 changed files with 20 additions and 49 deletions.
5 changes: 2 additions & 3 deletions assets/l10n/app_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -340,12 +340,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",
"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
4 changes: 2 additions & 2 deletions lib/generated/l10n/zulip_localizations.dart
Original file line number Diff line number Diff line change
Expand Up @@ -564,8 +564,8 @@ abstract class ZulipLocalizations {
/// 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 @@ -271,8 +271,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 @@ -271,8 +271,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 @@ -271,8 +271,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 @@ -271,8 +271,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 @@ -271,8 +271,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 @@ -271,8 +271,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 @@ -271,8 +271,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 @@ -587,7 +587,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 @@ -646,7 +646,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 22c2148

Please sign in to comment.