Skip to content

Commit 7f7aa98

Browse files
chrisbobbegnprice
authored andcommitted
action_sheet: Add "Subscribe"/"Unsubscribe" buttons to channel action sheet
Fixes #1224.
1 parent e1d378c commit 7f7aa98

18 files changed

+626
-1
lines changed

assets/l10n/app_en.arb

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,14 @@
9696
"@permissionsDeniedReadExternalStorage": {
9797
"description": "Message for dialog asking the user to grant permissions for external storage read access."
9898
},
99+
"actionSheetOptionSubscribe": "Subscribe",
100+
"@actionSheetOptionSubscribe": {
101+
"description": "Label in the channel action sheet for subscribing to the channel."
102+
},
103+
"subscribeFailedTitle": "Failed to subscribe",
104+
"@subscribeFailedTitle": {
105+
"description": "Error title when subscribing to a channel failed."
106+
},
99107
"actionSheetOptionMarkChannelAsRead": "Mark channel as read",
100108
"@actionSheetOptionMarkChannelAsRead": {
101109
"description": "Label for marking a channel as read."
@@ -108,6 +116,29 @@
108116
"@actionSheetOptionListOfTopics": {
109117
"description": "Label for navigating to a channel's topic-list page."
110118
},
119+
"actionSheetOptionUnsubscribe": "Unsubscribe",
120+
"@actionSheetOptionUnsubscribe": {
121+
"description": "Label in the channel action sheet for unsubscribing from the channel."
122+
},
123+
"unsubscribeConfirmationDialogTitle": "Unsubscribe from {channelName}?",
124+
"@unsubscribeConfirmationDialogTitle": {
125+
"description": "Title for a confirmation dialog for unsubscribing from a channel.",
126+
"placeholders": {
127+
"channelName": {"type": "String", "example": "mobile"}
128+
}
129+
},
130+
"unsubscribeConfirmationDialogMessageMaybeCannotResubscribe": "Once you leave this channel, you might not be able to rejoin.",
131+
"@unsubscribeConfirmationDialogMessageMaybeCannotResubscribe": {
132+
"description": "Message for a confirmation dialog for unsubscribing from a channel when you might not have permission to resubscribe."
133+
},
134+
"unsubscribeConfirmationDialogConfirmButton": "Unsubscribe",
135+
"@unsubscribeConfirmationDialogConfirmButton": {
136+
"description": "Label for the 'Unsubscribe' button on a confirmation dialog for unsubscribing from a channel."
137+
},
138+
"unsubscribeFailedTitle": "Failed to unsubscribe",
139+
"@unsubscribeFailedTitle": {
140+
"description": "Error title when unsubscribing from a channel failed."
141+
},
111142
"actionSheetOptionMuteTopic": "Mute topic",
112143
"@actionSheetOptionMuteTopic": {
113144
"description": "Label for muting a topic on action sheet."

lib/generated/l10n/zulip_localizations.dart

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,18 @@ abstract class ZulipLocalizations {
275275
/// **'To upload files, please grant Zulip additional permissions in Settings.'**
276276
String get permissionsDeniedReadExternalStorage;
277277

278+
/// Label in the channel context menu for subscribing to the channel.
279+
///
280+
/// In en, this message translates to:
281+
/// **'Subscribe'**
282+
String get actionSheetOptionSubscribe;
283+
284+
/// Error title when subscribing to a channel failed.
285+
///
286+
/// In en, this message translates to:
287+
/// **'Failed to subscribe'**
288+
String get subscribeFailedTitle;
289+
278290
/// Label for marking a channel as read.
279291
///
280292
/// In en, this message translates to:
@@ -293,6 +305,36 @@ abstract class ZulipLocalizations {
293305
/// **'List of topics'**
294306
String get actionSheetOptionListOfTopics;
295307

308+
/// Label in the channel context menu for unsubscribing from the channel.
309+
///
310+
/// In en, this message translates to:
311+
/// **'Unsubscribe'**
312+
String get actionSheetOptionUnsubscribe;
313+
314+
/// Title for a confirmation dialog for unsubscribing from a channel.
315+
///
316+
/// In en, this message translates to:
317+
/// **'Unsubscribe from {channelName}?'**
318+
String unsubscribeConfirmationDialogTitle(String channelName);
319+
320+
/// Message for a confirmation dialog for unsubscribing from a channel when you might not have permission to resubscribe.
321+
///
322+
/// In en, this message translates to:
323+
/// **'Once you leave this channel, you might not be able to rejoin.'**
324+
String get unsubscribeConfirmationDialogMessageMaybeCannotResubscribe;
325+
326+
/// Label for the 'Unsubscribe' button on a confirmation dialog for unsubscribing from a channel.
327+
///
328+
/// In en, this message translates to:
329+
/// **'Unsubscribe'**
330+
String get unsubscribeConfirmationDialogConfirmButton;
331+
332+
/// Error title when unsubscribing from a channel failed.
333+
///
334+
/// In en, this message translates to:
335+
/// **'Failed to unsubscribe'**
336+
String get unsubscribeFailedTitle;
337+
296338
/// Label for muting a topic on action sheet.
297339
///
298340
/// In en, this message translates to:

lib/generated/l10n/zulip_localizations_ar.dart

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,12 @@ class ZulipLocalizationsAr extends ZulipLocalizations {
8787
String get permissionsDeniedReadExternalStorage =>
8888
'To upload files, please grant Zulip additional permissions in Settings.';
8989

90+
@override
91+
String get actionSheetOptionSubscribe => 'Subscribe';
92+
93+
@override
94+
String get subscribeFailedTitle => 'Failed to subscribe';
95+
9096
@override
9197
String get actionSheetOptionMarkChannelAsRead => 'Mark channel as read';
9298

@@ -96,6 +102,24 @@ class ZulipLocalizationsAr extends ZulipLocalizations {
96102
@override
97103
String get actionSheetOptionListOfTopics => 'List of topics';
98104

105+
@override
106+
String get actionSheetOptionUnsubscribe => 'Unsubscribe';
107+
108+
@override
109+
String unsubscribeConfirmationDialogTitle(String channelName) {
110+
return 'Unsubscribe from $channelName?';
111+
}
112+
113+
@override
114+
String get unsubscribeConfirmationDialogMessageMaybeCannotResubscribe =>
115+
'Once you leave this channel, you might not be able to rejoin.';
116+
117+
@override
118+
String get unsubscribeConfirmationDialogConfirmButton => 'Unsubscribe';
119+
120+
@override
121+
String get unsubscribeFailedTitle => 'Failed to unsubscribe';
122+
99123
@override
100124
String get actionSheetOptionMuteTopic => 'Mute topic';
101125

lib/generated/l10n/zulip_localizations_de.dart

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,12 @@ class ZulipLocalizationsDe extends ZulipLocalizations {
8888
String get permissionsDeniedReadExternalStorage =>
8989
'Bitte gewähre Zulip zusätzliche Berechtigungen in den Einstellungen, um Dateien hochzuladen.';
9090

91+
@override
92+
String get actionSheetOptionSubscribe => 'Subscribe';
93+
94+
@override
95+
String get subscribeFailedTitle => 'Failed to subscribe';
96+
9197
@override
9298
String get actionSheetOptionMarkChannelAsRead =>
9399
'Kanal als gelesen markieren';
@@ -98,6 +104,24 @@ class ZulipLocalizationsDe extends ZulipLocalizations {
98104
@override
99105
String get actionSheetOptionListOfTopics => 'Themenliste';
100106

107+
@override
108+
String get actionSheetOptionUnsubscribe => 'Unsubscribe';
109+
110+
@override
111+
String unsubscribeConfirmationDialogTitle(String channelName) {
112+
return 'Unsubscribe from $channelName?';
113+
}
114+
115+
@override
116+
String get unsubscribeConfirmationDialogMessageMaybeCannotResubscribe =>
117+
'Once you leave this channel, you might not be able to rejoin.';
118+
119+
@override
120+
String get unsubscribeConfirmationDialogConfirmButton => 'Unsubscribe';
121+
122+
@override
123+
String get unsubscribeFailedTitle => 'Failed to unsubscribe';
124+
101125
@override
102126
String get actionSheetOptionMuteTopic => 'Thema stummschalten';
103127

lib/generated/l10n/zulip_localizations_en.dart

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,12 @@ class ZulipLocalizationsEn extends ZulipLocalizations {
8787
String get permissionsDeniedReadExternalStorage =>
8888
'To upload files, please grant Zulip additional permissions in Settings.';
8989

90+
@override
91+
String get actionSheetOptionSubscribe => 'Subscribe';
92+
93+
@override
94+
String get subscribeFailedTitle => 'Failed to subscribe';
95+
9096
@override
9197
String get actionSheetOptionMarkChannelAsRead => 'Mark channel as read';
9298

@@ -96,6 +102,24 @@ class ZulipLocalizationsEn extends ZulipLocalizations {
96102
@override
97103
String get actionSheetOptionListOfTopics => 'List of topics';
98104

105+
@override
106+
String get actionSheetOptionUnsubscribe => 'Unsubscribe';
107+
108+
@override
109+
String unsubscribeConfirmationDialogTitle(String channelName) {
110+
return 'Unsubscribe from $channelName?';
111+
}
112+
113+
@override
114+
String get unsubscribeConfirmationDialogMessageMaybeCannotResubscribe =>
115+
'Once you leave this channel, you might not be able to rejoin.';
116+
117+
@override
118+
String get unsubscribeConfirmationDialogConfirmButton => 'Unsubscribe';
119+
120+
@override
121+
String get unsubscribeFailedTitle => 'Failed to unsubscribe';
122+
99123
@override
100124
String get actionSheetOptionMuteTopic => 'Mute topic';
101125

lib/generated/l10n/zulip_localizations_fr.dart

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,12 @@ class ZulipLocalizationsFr extends ZulipLocalizations {
8787
String get permissionsDeniedReadExternalStorage =>
8888
'To upload files, please grant Zulip additional permissions in Settings.';
8989

90+
@override
91+
String get actionSheetOptionSubscribe => 'Subscribe';
92+
93+
@override
94+
String get subscribeFailedTitle => 'Failed to subscribe';
95+
9096
@override
9197
String get actionSheetOptionMarkChannelAsRead => 'Mark channel as read';
9298

@@ -96,6 +102,24 @@ class ZulipLocalizationsFr extends ZulipLocalizations {
96102
@override
97103
String get actionSheetOptionListOfTopics => 'List of topics';
98104

105+
@override
106+
String get actionSheetOptionUnsubscribe => 'Unsubscribe';
107+
108+
@override
109+
String unsubscribeConfirmationDialogTitle(String channelName) {
110+
return 'Unsubscribe from $channelName?';
111+
}
112+
113+
@override
114+
String get unsubscribeConfirmationDialogMessageMaybeCannotResubscribe =>
115+
'Once you leave this channel, you might not be able to rejoin.';
116+
117+
@override
118+
String get unsubscribeConfirmationDialogConfirmButton => 'Unsubscribe';
119+
120+
@override
121+
String get unsubscribeFailedTitle => 'Failed to unsubscribe';
122+
99123
@override
100124
String get actionSheetOptionMuteTopic => 'Mute topic';
101125

lib/generated/l10n/zulip_localizations_it.dart

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,12 @@ class ZulipLocalizationsIt extends ZulipLocalizations {
8888
String get permissionsDeniedReadExternalStorage =>
8989
'Per caricare file, bisogna concedere a Zulip autorizzazioni aggiuntive nelle Impostazioni.';
9090

91+
@override
92+
String get actionSheetOptionSubscribe => 'Subscribe';
93+
94+
@override
95+
String get subscribeFailedTitle => 'Failed to subscribe';
96+
9197
@override
9298
String get actionSheetOptionMarkChannelAsRead => 'Segna il canale come letto';
9399

@@ -97,6 +103,24 @@ class ZulipLocalizationsIt extends ZulipLocalizations {
97103
@override
98104
String get actionSheetOptionListOfTopics => 'Elenco degli argomenti';
99105

106+
@override
107+
String get actionSheetOptionUnsubscribe => 'Unsubscribe';
108+
109+
@override
110+
String unsubscribeConfirmationDialogTitle(String channelName) {
111+
return 'Unsubscribe from $channelName?';
112+
}
113+
114+
@override
115+
String get unsubscribeConfirmationDialogMessageMaybeCannotResubscribe =>
116+
'Once you leave this channel, you might not be able to rejoin.';
117+
118+
@override
119+
String get unsubscribeConfirmationDialogConfirmButton => 'Unsubscribe';
120+
121+
@override
122+
String get unsubscribeFailedTitle => 'Failed to unsubscribe';
123+
100124
@override
101125
String get actionSheetOptionMuteTopic => 'Silenzia argomento';
102126

lib/generated/l10n/zulip_localizations_ja.dart

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,12 @@ class ZulipLocalizationsJa extends ZulipLocalizations {
8686
String get permissionsDeniedReadExternalStorage =>
8787
'To upload files, please grant Zulip additional permissions in Settings.';
8888

89+
@override
90+
String get actionSheetOptionSubscribe => 'Subscribe';
91+
92+
@override
93+
String get subscribeFailedTitle => 'Failed to subscribe';
94+
8995
@override
9096
String get actionSheetOptionMarkChannelAsRead => 'チャンネルを既読にする';
9197

@@ -95,6 +101,24 @@ class ZulipLocalizationsJa extends ZulipLocalizations {
95101
@override
96102
String get actionSheetOptionListOfTopics => 'トピック一覧';
97103

104+
@override
105+
String get actionSheetOptionUnsubscribe => 'Unsubscribe';
106+
107+
@override
108+
String unsubscribeConfirmationDialogTitle(String channelName) {
109+
return 'Unsubscribe from $channelName?';
110+
}
111+
112+
@override
113+
String get unsubscribeConfirmationDialogMessageMaybeCannotResubscribe =>
114+
'Once you leave this channel, you might not be able to rejoin.';
115+
116+
@override
117+
String get unsubscribeConfirmationDialogConfirmButton => 'Unsubscribe';
118+
119+
@override
120+
String get unsubscribeFailedTitle => 'Failed to unsubscribe';
121+
98122
@override
99123
String get actionSheetOptionMuteTopic => 'トピックをミュート';
100124

lib/generated/l10n/zulip_localizations_nb.dart

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,12 @@ class ZulipLocalizationsNb extends ZulipLocalizations {
8787
String get permissionsDeniedReadExternalStorage =>
8888
'To upload files, please grant Zulip additional permissions in Settings.';
8989

90+
@override
91+
String get actionSheetOptionSubscribe => 'Subscribe';
92+
93+
@override
94+
String get subscribeFailedTitle => 'Failed to subscribe';
95+
9096
@override
9197
String get actionSheetOptionMarkChannelAsRead => 'Mark channel as read';
9298

@@ -96,6 +102,24 @@ class ZulipLocalizationsNb extends ZulipLocalizations {
96102
@override
97103
String get actionSheetOptionListOfTopics => 'List of topics';
98104

105+
@override
106+
String get actionSheetOptionUnsubscribe => 'Unsubscribe';
107+
108+
@override
109+
String unsubscribeConfirmationDialogTitle(String channelName) {
110+
return 'Unsubscribe from $channelName?';
111+
}
112+
113+
@override
114+
String get unsubscribeConfirmationDialogMessageMaybeCannotResubscribe =>
115+
'Once you leave this channel, you might not be able to rejoin.';
116+
117+
@override
118+
String get unsubscribeConfirmationDialogConfirmButton => 'Unsubscribe';
119+
120+
@override
121+
String get unsubscribeFailedTitle => 'Failed to unsubscribe';
122+
99123
@override
100124
String get actionSheetOptionMuteTopic => 'Mute topic';
101125

0 commit comments

Comments
 (0)