Skip to content

Commit 44f12dd

Browse files
committed
action_sheet: Support muting/unmuting/following topics
Currently, we don't have buttons, like "resolve topic", other than the ones added here. The switch statements follow the layout of the legacy app implementation. See also: https://github.com/zulip/zulip-mobile/blob/715d60a5e87fe37032bce58bd72edb99208e15be/src/action-sheets/index.js#L656-L753 Fixes: #348 Signed-off-by: Zixuan James Li <[email protected]>
1 parent 429fc95 commit 44f12dd

9 files changed

+667
-1
lines changed

assets/l10n/app_en.arb

+32
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,22 @@
5959
"@permissionsDeniedReadExternalStorage": {
6060
"description": "Message for dialog asking the user to grant permissions for external storage read access."
6161
},
62+
"actionSheetOptionMuteTopic": "Mute topic",
63+
"@actionSheetOptionMuteTopic": {
64+
"description": "Label for muting a topic on action sheet."
65+
},
66+
"actionSheetOptionUnmuteTopic": "Unmute topic",
67+
"@actionSheetOptionUnmuteTopic": {
68+
"description": "Label for unmuting a topic on action sheet."
69+
},
70+
"actionSheetOptionFollowTopic": "Follow topic",
71+
"@actionSheetOptionFollowTopic": {
72+
"description": "Label for following a topic on action sheet."
73+
},
74+
"actionSheetOptionUnfollowTopic": "Unfollow topic",
75+
"@actionSheetOptionUnfollowTopic": {
76+
"description": "Label for unfollowing a topic on action sheet."
77+
},
6278
"actionSheetOptionCopyMessageText": "Copy message text",
6379
"@actionSheetOptionCopyMessageText": {
6480
"description": "Label for copy message text button on action sheet."
@@ -201,6 +217,22 @@
201217
"event": {"type": "String", "example": "UpdateMessageEvent(id: 123, messageIds: [2345, 3456], newTopic: 'dinner')"}
202218
}
203219
},
220+
"errorMuteTopicFailed": "Failed to mute topic",
221+
"@errorMuteTopicFailed": {
222+
"description": "Error message when muting a topic failed."
223+
},
224+
"errorUnmuteTopicFailed": "Failed to unmute topic",
225+
"@errorUnmuteTopicFailed": {
226+
"description": "Error message when unmuting a topic failed."
227+
},
228+
"errorFollowTopicFailed": "Failed to follow topic",
229+
"@errorFollowTopicFailed": {
230+
"description": "Error message when following a topic failed."
231+
},
232+
"errorUnfollowTopicFailed": "Failed to unfollow topic",
233+
"@errorUnfollowTopicFailed": {
234+
"description": "Error message when unfollowing a topic failed."
235+
},
204236
"errorSharingFailed": "Sharing failed",
205237
"@errorSharingFailed": {
206238
"description": "Error message when sharing a message failed."

lib/generated/l10n/zulip_localizations.dart

+48
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,30 @@ abstract class ZulipLocalizations {
187187
/// **'To upload files, please grant Zulip additional permissions in Settings.'**
188188
String get permissionsDeniedReadExternalStorage;
189189

190+
/// Label for muting a topic on action sheet.
191+
///
192+
/// In en, this message translates to:
193+
/// **'Mute topic'**
194+
String get actionSheetOptionMuteTopic;
195+
196+
/// Label for unmuting a topic on action sheet.
197+
///
198+
/// In en, this message translates to:
199+
/// **'Unmute topic'**
200+
String get actionSheetOptionUnmuteTopic;
201+
202+
/// Label for following a topic on action sheet.
203+
///
204+
/// In en, this message translates to:
205+
/// **'Follow topic'**
206+
String get actionSheetOptionFollowTopic;
207+
208+
/// Label for unfollowing a topic on action sheet.
209+
///
210+
/// In en, this message translates to:
211+
/// **'Unfollow topic'**
212+
String get actionSheetOptionUnfollowTopic;
213+
190214
/// Label for copy message text button on action sheet.
191215
///
192216
/// In en, this message translates to:
@@ -355,6 +379,30 @@ abstract class ZulipLocalizations {
355379
/// **'Error handling a Zulip event from {serverUrl}; will retry.\n\nError: {error}\n\nEvent: {event}'**
356380
String errorHandlingEventDetails(String serverUrl, String error, String event);
357381

382+
/// Error message when muting a topic failed.
383+
///
384+
/// In en, this message translates to:
385+
/// **'Failed to mute topic'**
386+
String get errorMuteTopicFailed;
387+
388+
/// Error message when unmuting a topic failed.
389+
///
390+
/// In en, this message translates to:
391+
/// **'Failed to unmute topic'**
392+
String get errorUnmuteTopicFailed;
393+
394+
/// Error message when following a topic failed.
395+
///
396+
/// In en, this message translates to:
397+
/// **'Failed to follow topic'**
398+
String get errorFollowTopicFailed;
399+
400+
/// Error message when unfollowing a topic failed.
401+
///
402+
/// In en, this message translates to:
403+
/// **'Failed to unfollow topic'**
404+
String get errorUnfollowTopicFailed;
405+
358406
/// Error message when sharing a message failed.
359407
///
360408
/// In en, this message translates to:

lib/generated/l10n/zulip_localizations_ar.dart

+24
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,18 @@ class ZulipLocalizationsAr extends ZulipLocalizations {
5353
@override
5454
String get permissionsDeniedReadExternalStorage => 'To upload files, please grant Zulip additional permissions in Settings.';
5555

56+
@override
57+
String get actionSheetOptionMuteTopic => 'Mute topic';
58+
59+
@override
60+
String get actionSheetOptionUnmuteTopic => 'Unmute topic';
61+
62+
@override
63+
String get actionSheetOptionFollowTopic => 'Follow topic';
64+
65+
@override
66+
String get actionSheetOptionUnfollowTopic => 'Unfollow topic';
67+
5668
@override
5769
String get actionSheetOptionCopyMessageText => 'Copy message text';
5870

@@ -165,6 +177,18 @@ class ZulipLocalizationsAr extends ZulipLocalizations {
165177
return 'Error handling a Zulip event from $serverUrl; will retry.\n\nError: $error\n\nEvent: $event';
166178
}
167179

180+
@override
181+
String get errorMuteTopicFailed => 'Failed to mute topic';
182+
183+
@override
184+
String get errorUnmuteTopicFailed => 'Failed to unmute topic';
185+
186+
@override
187+
String get errorFollowTopicFailed => 'Failed to follow topic';
188+
189+
@override
190+
String get errorUnfollowTopicFailed => 'Failed to unfollow topic';
191+
168192
@override
169193
String get errorSharingFailed => 'Sharing failed';
170194

lib/generated/l10n/zulip_localizations_en.dart

+24
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,18 @@ class ZulipLocalizationsEn extends ZulipLocalizations {
5353
@override
5454
String get permissionsDeniedReadExternalStorage => 'To upload files, please grant Zulip additional permissions in Settings.';
5555

56+
@override
57+
String get actionSheetOptionMuteTopic => 'Mute topic';
58+
59+
@override
60+
String get actionSheetOptionUnmuteTopic => 'Unmute topic';
61+
62+
@override
63+
String get actionSheetOptionFollowTopic => 'Follow topic';
64+
65+
@override
66+
String get actionSheetOptionUnfollowTopic => 'Unfollow topic';
67+
5668
@override
5769
String get actionSheetOptionCopyMessageText => 'Copy message text';
5870

@@ -165,6 +177,18 @@ class ZulipLocalizationsEn extends ZulipLocalizations {
165177
return 'Error handling a Zulip event from $serverUrl; will retry.\n\nError: $error\n\nEvent: $event';
166178
}
167179

180+
@override
181+
String get errorMuteTopicFailed => 'Failed to mute topic';
182+
183+
@override
184+
String get errorUnmuteTopicFailed => 'Failed to unmute topic';
185+
186+
@override
187+
String get errorFollowTopicFailed => 'Failed to follow topic';
188+
189+
@override
190+
String get errorUnfollowTopicFailed => 'Failed to unfollow topic';
191+
168192
@override
169193
String get errorSharingFailed => 'Sharing failed';
170194

lib/generated/l10n/zulip_localizations_ja.dart

+24
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,18 @@ class ZulipLocalizationsJa extends ZulipLocalizations {
5353
@override
5454
String get permissionsDeniedReadExternalStorage => 'To upload files, please grant Zulip additional permissions in Settings.';
5555

56+
@override
57+
String get actionSheetOptionMuteTopic => 'Mute topic';
58+
59+
@override
60+
String get actionSheetOptionUnmuteTopic => 'Unmute topic';
61+
62+
@override
63+
String get actionSheetOptionFollowTopic => 'Follow topic';
64+
65+
@override
66+
String get actionSheetOptionUnfollowTopic => 'Unfollow topic';
67+
5668
@override
5769
String get actionSheetOptionCopyMessageText => 'Copy message text';
5870

@@ -165,6 +177,18 @@ class ZulipLocalizationsJa extends ZulipLocalizations {
165177
return 'Error handling a Zulip event from $serverUrl; will retry.\n\nError: $error\n\nEvent: $event';
166178
}
167179

180+
@override
181+
String get errorMuteTopicFailed => 'Failed to mute topic';
182+
183+
@override
184+
String get errorUnmuteTopicFailed => 'Failed to unmute topic';
185+
186+
@override
187+
String get errorFollowTopicFailed => 'Failed to follow topic';
188+
189+
@override
190+
String get errorUnfollowTopicFailed => 'Failed to unfollow topic';
191+
168192
@override
169193
String get errorSharingFailed => 'Sharing failed';
170194

0 commit comments

Comments
 (0)