mirror of
https://github.com/krille-chan/fluffychat
synced 2024-09-10 04:25:15 +00:00
chore: Follow up localize join rules
This commit is contained in:
parent
4353c8ddd1
commit
2d5f496d3c
2 changed files with 18 additions and 2 deletions
|
@ -2279,6 +2279,8 @@
|
|||
"user": {}
|
||||
}
|
||||
},
|
||||
"usersMustKnock": "Users must knock",
|
||||
"noOneCanJoin": "No one can join",
|
||||
"userWouldLikeToChangeTheChat": "{user} would like to join the chat.",
|
||||
"@userWouldLikeToChangeTheChat": {
|
||||
"placeholders": {
|
||||
|
|
|
@ -61,8 +61,7 @@ class ChatAccessSettingsPageView extends StatelessWidget {
|
|||
for (final joinRule in JoinRules.values)
|
||||
RadioListTile<JoinRules>.adaptive(
|
||||
title: Text(
|
||||
joinRule
|
||||
.getLocalizedString(MatrixLocals(L10n.of(context)!)),
|
||||
joinRule.localizedString(L10n.of(context)!),
|
||||
),
|
||||
value: joinRule,
|
||||
groupValue: room.joinRules,
|
||||
|
@ -170,3 +169,18 @@ class ChatAccessSettingsPageView extends StatelessWidget {
|
|||
);
|
||||
}
|
||||
}
|
||||
|
||||
extension JoinRulesDisplayString on JoinRules {
|
||||
String localizedString(L10n l10n) {
|
||||
switch (this) {
|
||||
case JoinRules.public:
|
||||
return l10n.anyoneCanJoin;
|
||||
case JoinRules.invite:
|
||||
return l10n.invitedUsersOnly;
|
||||
case JoinRules.knock:
|
||||
return l10n.usersMustKnock;
|
||||
case JoinRules.private:
|
||||
return l10n.noOneCanJoin;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue