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": {}
|
"user": {}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"usersMustKnock": "Users must knock",
|
||||||
|
"noOneCanJoin": "No one can join",
|
||||||
"userWouldLikeToChangeTheChat": "{user} would like to join the chat.",
|
"userWouldLikeToChangeTheChat": "{user} would like to join the chat.",
|
||||||
"@userWouldLikeToChangeTheChat": {
|
"@userWouldLikeToChangeTheChat": {
|
||||||
"placeholders": {
|
"placeholders": {
|
||||||
|
|
|
||||||
|
|
@ -61,8 +61,7 @@ class ChatAccessSettingsPageView extends StatelessWidget {
|
||||||
for (final joinRule in JoinRules.values)
|
for (final joinRule in JoinRules.values)
|
||||||
RadioListTile<JoinRules>.adaptive(
|
RadioListTile<JoinRules>.adaptive(
|
||||||
title: Text(
|
title: Text(
|
||||||
joinRule
|
joinRule.localizedString(L10n.of(context)!),
|
||||||
.getLocalizedString(MatrixLocals(L10n.of(context)!)),
|
|
||||||
),
|
),
|
||||||
value: joinRule,
|
value: joinRule,
|
||||||
groupValue: room.joinRules,
|
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…
Add table
Add a link
Reference in a new issue