updated capacity copy to correspond with room type (chat or space)

pull/1384/head
ggurdin 1 year ago
parent 46a6813b26
commit a32eb15df7
No known key found for this signature in database
GPG Key ID: A01CB41737CBB478

@ -4041,14 +4041,38 @@
"tooltipInstructionsMobileBody": "Press and hold items to view tooltips.", "tooltipInstructionsMobileBody": "Press and hold items to view tooltips.",
"tooltipInstructionsBrowserBody": "Hover over items to view tooltips.", "tooltipInstructionsBrowserBody": "Hover over items to view tooltips.",
"addSpaceToSpaceDescription": "Select a space to add as a parent", "addSpaceToSpaceDescription": "Select a space to add as a parent",
"roomCapacity": "Room Capacity", "roomCapacity": "{roomType} Capacity",
"@roomCapacity": {
"type": "text",
"placeholders": {
"roomType": {}
}
},
"roomFull": "This room is already at capacity.", "roomFull": "This room is already at capacity.",
"topicNotSet": "The topic has not been set.", "topicNotSet": "The topic has not been set.",
"capacityNotSet": "This room has no capacity limit.", "capacityNotSet": "This room has no capacity limit.",
"roomCapacityHasBeenChanged": "Room capacity changed", "roomCapacityHasBeenChanged": "{roomType} capacity changed",
"@roomCapacityHasBeenChanged": {
"type": "text",
"placeholders": {
"roomType": {}
}
},
"roomExceedsCapacity": "Room exceeds capacity. Consider removing students from the room, or raising the capacity.", "roomExceedsCapacity": "Room exceeds capacity. Consider removing students from the room, or raising the capacity.",
"capacitySetTooLow": "Room capacity cannot be set below the current number of non-admins.", "capacitySetTooLow": "{roomType} capacity cannot be set below the current number of non-admins.",
"roomCapacityExplanation": "Room capacity limits the number of non-admins allowed in a room.", "@capacitySetTooLow": {
"type": "text",
"placeholders": {
"roomType": {}
}
},
"roomCapacityExplanation": "{roomType} capacity limits the number of non-admins allowed in a room.",
"@roomCapacityExplanation": {
"type": "text",
"placeholders": {
"roomType": {}
}
},
"enterNumber": "Please enter a whole number value.", "enterNumber": "Please enter a whole number value.",
"buildTranslation": "Build your translation from the choices above", "buildTranslation": "Build your translation from the choices above",
"noDatabaseEncryption": "Database encryption is not supported on this platform", "noDatabaseEncryption": "Database encryption is not supported on this platform",
@ -4129,5 +4153,6 @@
"error520Title": "Please try again.", "error520Title": "Please try again.",
"error520Desc": "Sorry, we could not understand your message...", "error520Desc": "Sorry, we could not understand your message...",
"translationChoicesBody": "Click and hold an option for a hint.", "translationChoicesBody": "Click and hold an option for a hint.",
"sendCanceled": "Sending canceled" "sendCanceled": "Sending canceled",
"space": "Space"
} }

@ -115,6 +115,7 @@ class NewSpaceView extends StatelessWidget {
RoomCapacityButton( RoomCapacityButton(
key: controller.addCapacityKey, key: controller.addCapacityKey,
spaceMode: true,
), ),
// commenting out language settings in spaces for now // commenting out language settings in spaces for now
// LanguageSettings( // LanguageSettings(

@ -9,10 +9,13 @@ import 'package:matrix/matrix.dart';
class RoomCapacityButton extends StatefulWidget { class RoomCapacityButton extends StatefulWidget {
final Room? room; final Room? room;
final ChatDetailsController? controller; final ChatDetailsController? controller;
final bool spaceMode;
const RoomCapacityButton({ const RoomCapacityButton({
super.key, super.key,
this.room, this.room,
this.controller, this.controller,
this.spaceMode = false,
}); });
@override @override
@ -66,6 +69,15 @@ class RoomCapacityButtonState extends State<RoomCapacityButton> {
} }
} }
String get roomType {
final String chat = L10n.of(context)!.chat;
final String space = L10n.of(context)!.space;
if (widget.room != null) {
return widget.room!.isSpace ? space : chat;
}
return widget.spaceMode ? space : chat;
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final iconColor = Theme.of(context).textTheme.bodyLarge!.color; final iconColor = Theme.of(context).textTheme.bodyLarge!.color;
@ -86,7 +98,7 @@ class RoomCapacityButtonState extends State<RoomCapacityButton> {
: '$capacity', : '$capacity',
), ),
title: Text( title: Text(
L10n.of(context)!.roomCapacity, L10n.of(context)!.roomCapacity(roomType),
style: TextStyle( style: TextStyle(
color: Theme.of(context).colorScheme.secondary, color: Theme.of(context).colorScheme.secondary,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
@ -104,8 +116,8 @@ class RoomCapacityButtonState extends State<RoomCapacityButton> {
Future<void> setRoomCapacity() async { Future<void> setRoomCapacity() async {
final input = await showTextInputDialog( final input = await showTextInputDialog(
context: context, context: context,
title: L10n.of(context)!.roomCapacity, title: L10n.of(context)!.roomCapacity(roomType),
message: L10n.of(context)!.roomCapacityExplanation, message: L10n.of(context)!.roomCapacityExplanation(roomType),
okLabel: L10n.of(context)!.ok, okLabel: L10n.of(context)!.ok,
cancelLabel: L10n.of(context)!.cancel, cancelLabel: L10n.of(context)!.cancel,
textFields: [ textFields: [
@ -121,7 +133,7 @@ class RoomCapacityButtonState extends State<RoomCapacityButton> {
return L10n.of(context)!.enterNumber; return L10n.of(context)!.enterNumber;
} }
if (nonAdmins != null && int.parse(value) < int.parse(nonAdmins!)) { if (nonAdmins != null && int.parse(value) < int.parse(nonAdmins!)) {
return L10n.of(context)!.capacitySetTooLow; return L10n.of(context)!.capacitySetTooLow(roomType);
} }
return null; return null;
}, },
@ -147,7 +159,7 @@ class RoomCapacityButtonState extends State<RoomCapacityButton> {
ScaffoldMessenger.of(context).showSnackBar( ScaffoldMessenger.of(context).showSnackBar(
SnackBar( SnackBar(
content: Text( content: Text(
L10n.of(context)!.roomCapacityHasBeenChanged, L10n.of(context)!.roomCapacityHasBeenChanged(roomType),
), ),
), ),
); );

Loading…
Cancel
Save