Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions assets/l10n/app_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -1388,6 +1388,38 @@
"@wildcardMentionTopicDescription": {
"description": "Description for \"@topic\" wildcard-mention autocomplete options when writing a channel message."
},
"systemGroupNameEveryoneOnInternet": "Everyone on the internet",
"@systemGroupNameEveryoneOnInternet": {
"description": "Display name for the system group that includes everyone on the internet."
},
"systemGroupNameEveryone": "Everyone including guests",
"@systemGroupNameEveryone": {
"description": "Display name for the system group that includes all users including guests."
},
"systemGroupNameMembers": "Everyone except guests",
"@systemGroupNameMembers": {
"description": "Display name for the system group that includes all users excluding guests."
},
"systemGroupNameFullMembers": "Full members",
"@systemGroupNameFullMembers": {
"description": "Display name for the system group that includes all full members of the organization."
},
"systemGroupNameModerators": "Moderators",
"@systemGroupNameModerators": {
"description": "Display name for the system group that includes all users with at least the moderator role."
},
"systemGroupNameAdministrators": "Administrators",
"@systemGroupNameAdministrators": {
"description": "Display name for the system group that includes all users with at least the administrator role."
},
"systemGroupNameOwners": "Owners",
"@systemGroupNameOwners": {
"description": "Display name for the system group that includes all users with the owner role."
},
"systemGroupNameNobody": "Nobody",
"@systemGroupNameNobody": {
"description": "Display name for the system group that includes nobody."
},
"navBarFeedLabel": "Feed",
"@navBarFeedLabel": {
"description": "Label for the Feed button on the bottom navigation bar."
Expand Down
25 changes: 25 additions & 0 deletions lib/api/model/permission.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import 'package:json_annotation/json_annotation.dart';

import '../../generated/l10n/zulip_localizations.dart';

part 'permission.g.dart';

/// Metadata about how to interpret the various group-based permission settings.
Expand Down Expand Up @@ -351,4 +353,27 @@ enum SystemGroupName implements DefaultGroupName {

@override
String toJson() => _$SystemGroupNameEnumMap[this]!;

/// Get the display name to use in the UI for this system group.
///
/// Display names mirror the web app's display name strings.
/// See `system_user_groups_list` in web/src/settings_config.ts.
String displayName(ZulipLocalizations zulipLocalizations) => switch (this) {
SystemGroupName.everyoneOnInternet =>
zulipLocalizations.systemGroupNameEveryoneOnInternet,
SystemGroupName.everyone =>
zulipLocalizations.systemGroupNameEveryone,
SystemGroupName.members =>
zulipLocalizations.systemGroupNameMembers,
SystemGroupName.fullMembers =>
zulipLocalizations.systemGroupNameFullMembers,
SystemGroupName.moderators =>
zulipLocalizations.systemGroupNameModerators,
SystemGroupName.administrators =>
zulipLocalizations.systemGroupNameAdministrators,
SystemGroupName.owners =>
zulipLocalizations.systemGroupNameOwners,
SystemGroupName.nobody =>
zulipLocalizations.systemGroupNameNobody,
};
Comment on lines +357 to +378
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are these particular display names chosen? Is there API documentation you can link to in the dartdoc, so it's clear for people reading this code later?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The API docs contain a general description/explanation of the system roles, but do not contain the particular strings used in the web app code. I will add a dartdoc comment saying that the strings are taken from the web app code.

}
48 changes: 48 additions & 0 deletions lib/generated/l10n/zulip_localizations.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2012,6 +2012,54 @@ abstract class ZulipLocalizations {
/// **'Notify topic'**
String get wildcardMentionTopicDescription;

/// Display name for the system group that includes everyone on the internet.
///
/// In en, this message translates to:
/// **'Everyone on the internet'**
String get systemGroupNameEveryoneOnInternet;

/// Display name for the system group that includes all users including guests.
///
/// In en, this message translates to:
/// **'Everyone including guests'**
String get systemGroupNameEveryone;

/// Display name for the system group that includes all users excluding guests.
///
/// In en, this message translates to:
/// **'Everyone except guests'**
String get systemGroupNameMembers;

/// Display name for the system group that includes all full members of the organization.
///
/// In en, this message translates to:
/// **'Full members'**
String get systemGroupNameFullMembers;

/// Display name for the system group that includes all users with at least the moderator role.
///
/// In en, this message translates to:
/// **'Moderators'**
String get systemGroupNameModerators;

/// Display name for the system group that includes all users with at least the administrator role.
///
/// In en, this message translates to:
/// **'Administrators'**
String get systemGroupNameAdministrators;

/// Display name for the system group that includes all users with the owner role.
///
/// In en, this message translates to:
/// **'Owners'**
String get systemGroupNameOwners;

/// Display name for the system group that includes nobody.
///
/// In en, this message translates to:
/// **'Nobody'**
String get systemGroupNameNobody;

/// Label for the Feed button on the bottom navigation bar.
///
/// In en, this message translates to:
Expand Down
24 changes: 24 additions & 0 deletions lib/generated/l10n/zulip_localizations_ar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1168,6 +1168,30 @@ class ZulipLocalizationsAr extends ZulipLocalizations {
@override
String get wildcardMentionTopicDescription => 'إخطار الموضوع';

@override
String get systemGroupNameEveryoneOnInternet => 'Everyone on the internet';

@override
String get systemGroupNameEveryone => 'Everyone including guests';

@override
String get systemGroupNameMembers => 'Everyone except guests';

@override
String get systemGroupNameFullMembers => 'Full members';

@override
String get systemGroupNameModerators => 'Moderators';

@override
String get systemGroupNameAdministrators => 'Administrators';

@override
String get systemGroupNameOwners => 'Owners';

@override
String get systemGroupNameNobody => 'Nobody';

@override
String get navBarFeedLabel => 'Feed';

Expand Down
24 changes: 24 additions & 0 deletions lib/generated/l10n/zulip_localizations_de.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1194,6 +1194,30 @@ class ZulipLocalizationsDe extends ZulipLocalizations {
@override
String get wildcardMentionTopicDescription => 'Thema benachrichtigen';

@override
String get systemGroupNameEveryoneOnInternet => 'Everyone on the internet';

@override
String get systemGroupNameEveryone => 'Everyone including guests';

@override
String get systemGroupNameMembers => 'Everyone except guests';

@override
String get systemGroupNameFullMembers => 'Full members';

@override
String get systemGroupNameModerators => 'Moderators';

@override
String get systemGroupNameAdministrators => 'Administrators';

@override
String get systemGroupNameOwners => 'Owners';

@override
String get systemGroupNameNobody => 'Nobody';

@override
String get navBarFeedLabel => 'Feed';

Expand Down
24 changes: 24 additions & 0 deletions lib/generated/l10n/zulip_localizations_el.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1168,6 +1168,30 @@ class ZulipLocalizationsEl extends ZulipLocalizations {
@override
String get wildcardMentionTopicDescription => 'Notify topic';

@override
String get systemGroupNameEveryoneOnInternet => 'Everyone on the internet';

@override
String get systemGroupNameEveryone => 'Everyone including guests';

@override
String get systemGroupNameMembers => 'Everyone except guests';

@override
String get systemGroupNameFullMembers => 'Full members';

@override
String get systemGroupNameModerators => 'Moderators';

@override
String get systemGroupNameAdministrators => 'Administrators';

@override
String get systemGroupNameOwners => 'Owners';

@override
String get systemGroupNameNobody => 'Nobody';

@override
String get navBarFeedLabel => 'Feed';

Expand Down
24 changes: 24 additions & 0 deletions lib/generated/l10n/zulip_localizations_en.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1168,6 +1168,30 @@ class ZulipLocalizationsEn extends ZulipLocalizations {
@override
String get wildcardMentionTopicDescription => 'Notify topic';

@override
String get systemGroupNameEveryoneOnInternet => 'Everyone on the internet';

@override
String get systemGroupNameEveryone => 'Everyone including guests';

@override
String get systemGroupNameMembers => 'Everyone except guests';

@override
String get systemGroupNameFullMembers => 'Full members';

@override
String get systemGroupNameModerators => 'Moderators';

@override
String get systemGroupNameAdministrators => 'Administrators';

@override
String get systemGroupNameOwners => 'Owners';

@override
String get systemGroupNameNobody => 'Nobody';

@override
String get navBarFeedLabel => 'Feed';

Expand Down
24 changes: 24 additions & 0 deletions lib/generated/l10n/zulip_localizations_es.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1168,6 +1168,30 @@ class ZulipLocalizationsEs extends ZulipLocalizations {
@override
String get wildcardMentionTopicDescription => 'Notify topic';

@override
String get systemGroupNameEveryoneOnInternet => 'Everyone on the internet';

@override
String get systemGroupNameEveryone => 'Everyone including guests';

@override
String get systemGroupNameMembers => 'Everyone except guests';

@override
String get systemGroupNameFullMembers => 'Full members';

@override
String get systemGroupNameModerators => 'Moderators';

@override
String get systemGroupNameAdministrators => 'Administrators';

@override
String get systemGroupNameOwners => 'Owners';

@override
String get systemGroupNameNobody => 'Nobody';

@override
String get navBarFeedLabel => 'Feed';

Expand Down
24 changes: 24 additions & 0 deletions lib/generated/l10n/zulip_localizations_et.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1168,6 +1168,30 @@ class ZulipLocalizationsEt extends ZulipLocalizations {
@override
String get wildcardMentionTopicDescription => 'Notify topic';

@override
String get systemGroupNameEveryoneOnInternet => 'Everyone on the internet';

@override
String get systemGroupNameEveryone => 'Everyone including guests';

@override
String get systemGroupNameMembers => 'Everyone except guests';

@override
String get systemGroupNameFullMembers => 'Full members';

@override
String get systemGroupNameModerators => 'Moderators';

@override
String get systemGroupNameAdministrators => 'Administrators';

@override
String get systemGroupNameOwners => 'Owners';

@override
String get systemGroupNameNobody => 'Nobody';

@override
String get navBarFeedLabel => 'Feed';

Expand Down
24 changes: 24 additions & 0 deletions lib/generated/l10n/zulip_localizations_fr.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1205,6 +1205,30 @@ class ZulipLocalizationsFr extends ZulipLocalizations {
String get wildcardMentionTopicDescription =>
'Notifier les participants à cette conversation';

@override
String get systemGroupNameEveryoneOnInternet => 'Everyone on the internet';

@override
String get systemGroupNameEveryone => 'Everyone including guests';

@override
String get systemGroupNameMembers => 'Everyone except guests';

@override
String get systemGroupNameFullMembers => 'Full members';

@override
String get systemGroupNameModerators => 'Moderators';

@override
String get systemGroupNameAdministrators => 'Administrators';

@override
String get systemGroupNameOwners => 'Owners';

@override
String get systemGroupNameNobody => 'Nobody';

@override
String get navBarFeedLabel => 'Feed';

Expand Down
24 changes: 24 additions & 0 deletions lib/generated/l10n/zulip_localizations_he.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1168,6 +1168,30 @@ class ZulipLocalizationsHe extends ZulipLocalizations {
@override
String get wildcardMentionTopicDescription => 'Notify topic';

@override
String get systemGroupNameEveryoneOnInternet => 'Everyone on the internet';

@override
String get systemGroupNameEveryone => 'Everyone including guests';

@override
String get systemGroupNameMembers => 'Everyone except guests';

@override
String get systemGroupNameFullMembers => 'Full members';

@override
String get systemGroupNameModerators => 'Moderators';

@override
String get systemGroupNameAdministrators => 'Administrators';

@override
String get systemGroupNameOwners => 'Owners';

@override
String get systemGroupNameNobody => 'Nobody';

@override
String get navBarFeedLabel => 'Feed';

Expand Down
Loading