diff --git a/assets/l10n/intl_en.arb b/assets/l10n/intl_en.arb index d569f2d70..f1fa001f4 100644 --- a/assets/l10n/intl_en.arb +++ b/assets/l10n/intl_en.arb @@ -3903,7 +3903,7 @@ "define": "Define", "listen": "Listen", "addConversationBot": "Enable Conversation Bot", - "addConversationBotDesc": "Add a bot to this group chat", + "addConversationBotDesc": "Add a bot to this chat", "convoBotSettingsTitle": "Conversation Bot Settings", "convoBotSettingsDescription": "Edit conversation topic and difficulty", "enterAConversationTopic": "Enter a conversation topic", @@ -4059,14 +4059,38 @@ "tooltipInstructionsMobileBody": "Press and hold items to view tooltips.", "tooltipInstructionsBrowserBody": "Hover over items to view tooltips.", "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.", "topicNotSet": "The topic has not been set.", "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.", - "capacitySetTooLow": "Room 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": "{roomType} capacity cannot be set below the current number of non-admins.", + "@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.", "buildTranslation": "Build your translation from the choices above", "noDatabaseEncryption": "Database encryption is not supported on this platform", @@ -4201,5 +4225,8 @@ "whatIsAHomeserver": "What is a homeserver?", "homeserverDescription": "All your data is stored on the homeserver, just like an email provider. You can choose which homeserver you want to use, while you can still communicate with everyone. Learn more at at https://matrix.org.", "doesNotSeemToBeAValidHomeserver": "Doesn't seem to be a compatible homeserver. Wrong URL?", - "grammar": "Grammar" + "grammar": "Grammar", + "contactHasBeenInvitedToTheChat": "Contact has been invited to the chat", + "inviteChat": "📨 Invite chat", + "chatName": "Chat name" } \ No newline at end of file diff --git a/lib/pages/chat_list/chat_list.dart b/lib/pages/chat_list/chat_list.dart index 7c41eb72c..2d1302993 100644 --- a/lib/pages/chat_list/chat_list.dart +++ b/lib/pages/chat_list/chat_list.dart @@ -139,8 +139,11 @@ class ChatListController extends State final inviteAction = await showModalActionSheet( context: context, message: room.isDirectChat + // #Pangea ? L10n.of(context)!.invitePrivateChat - : L10n.of(context)!.inviteGroupChat, + // : L10n.of(context)!.inviteGroupChat, + : L10n.of(context)!.inviteChat, + // Pangea# title: room.getLocalizedDisplayname(MatrixLocals(L10n.of(context)!)), actions: [ SheetAction( diff --git a/lib/pages/chat_list/chat_list_item.dart b/lib/pages/chat_list/chat_list_item.dart index 5cae0c824..9cbe6af82 100644 --- a/lib/pages/chat_list/chat_list_item.dart +++ b/lib/pages/chat_list/chat_list_item.dart @@ -328,7 +328,10 @@ class ChatListItem extends StatelessWidget { room.membership == Membership.invite ? isDirectChat ? L10n.of(context)!.invitePrivateChat - : L10n.of(context)!.inviteGroupChat + // #Pangea + // : L10n.of(context)!.inviteGroupChat + : L10n.of(context)!.inviteChat + // Pangea# : snapshot.data ?? L10n.of(context)!.emptyChat, softWrap: false, diff --git a/lib/pages/chat_list/space_view.dart b/lib/pages/chat_list/space_view.dart index 79dce997f..589c0341c 100644 --- a/lib/pages/chat_list/space_view.dart +++ b/lib/pages/chat_list/space_view.dart @@ -319,7 +319,10 @@ class _SpaceViewState extends State { ), AlertDialogAction( key: AddRoomType.chat, - label: L10n.of(context)!.createGroup, + // #Pangea + // label: L10n.of(context)!.createGroup, + label: L10n.of(context)!.createChat, + // Pangea# ), ], ); @@ -329,12 +332,18 @@ class _SpaceViewState extends State { context: context, title: roomType == AddRoomType.subspace ? L10n.of(context)!.createNewSpace - : L10n.of(context)!.createGroup, + // #Pangea + // : L10n.of(context)!.createGroup, + : L10n.of(context)!.createChat, + // Pangea# textFields: [ DialogTextField( hintText: roomType == AddRoomType.subspace ? L10n.of(context)!.spaceName - : L10n.of(context)!.groupName, + // #Pangea + // : L10n.of(context)!.groupName, + : L10n.of(context)!.chatName, + // Pangea# minLines: 1, maxLines: 1, maxLength: 64, diff --git a/lib/pages/invitation_selection/invitation_selection.dart b/lib/pages/invitation_selection/invitation_selection.dart index e59e03819..761f43271 100644 --- a/lib/pages/invitation_selection/invitation_selection.dart +++ b/lib/pages/invitation_selection/invitation_selection.dart @@ -182,7 +182,10 @@ class InvitationSelectionController extends State { if (success.error == null) { ScaffoldMessenger.of(context).showSnackBar( SnackBar( - content: Text(L10n.of(context)!.contactHasBeenInvitedToTheGroup), + // #Pangea + // content: Text(L10n.of(context)!.contactHasBeenInvitedToTheGroup), + content: Text(L10n.of(context)!.contactHasBeenInvitedToTheChat), + // Pangea# ), ); } diff --git a/lib/pages/new_group/new_group_view.dart b/lib/pages/new_group/new_group_view.dart index 52ca198f0..6dfcec212 100644 --- a/lib/pages/new_group/new_group_view.dart +++ b/lib/pages/new_group/new_group_view.dart @@ -27,7 +27,10 @@ class NewGroupView extends StatelessWidget { onPressed: controller.loading ? null : Navigator.of(context).pop, ), ), - title: Text(L10n.of(context)!.createGroup), + // #Pangea + // title: Text(L10n.of(context)!.createGroup), + title: Text(L10n.of(context)!.createChat), + // Pangea# ), // #Pangea floatingActionButton: FloatingActionButton.extended( @@ -74,7 +77,10 @@ class NewGroupView extends StatelessWidget { readOnly: controller.loading, decoration: InputDecoration( prefixIcon: const Icon(Icons.people_outlined), - labelText: L10n.of(context)!.groupName, + // #Pangea + // labelText: L10n.of(context)!.groupName, + labelText: L10n.of(context)!.chatName, + // Pangea# ), ), ), diff --git a/lib/pages/new_private_chat/new_private_chat_view.dart b/lib/pages/new_private_chat/new_private_chat_view.dart index 0a7c3de4f..024e52bc7 100644 --- a/lib/pages/new_private_chat/new_private_chat_view.dart +++ b/lib/pages/new_private_chat/new_private_chat_view.dart @@ -140,7 +140,10 @@ class NewPrivateChatView extends StatelessWidget { foregroundColor: theme.colorScheme.onTertiaryContainer, child: const Icon(Icons.group_add_outlined), ), - title: Text(L10n.of(context)!.createGroup), + // #Pangea + // title: Text(L10n.of(context)!.createGroup), + title: Text(L10n.of(context)!.createChat), + // Pangea# onTap: () => context.go('/rooms/newgroup'), ), if (PlatformInfos.isMobile) diff --git a/lib/pages/new_space/new_space_view.dart b/lib/pages/new_space/new_space_view.dart index ae27607ab..087218a48 100644 --- a/lib/pages/new_space/new_space_view.dart +++ b/lib/pages/new_space/new_space_view.dart @@ -72,6 +72,7 @@ class NewSpaceView extends StatelessWidget { // #Pangea RoomCapacityButton( key: controller.addCapacityKey, + spaceMode: true, ), AddToSpaceToggles( key: controller.addToSpaceKey, diff --git a/lib/pangea/pages/class_invitation_selection/class_invitation_selection.dart b/lib/pangea/pages/class_invitation_selection/class_invitation_selection.dart index 0164f7b84..8289d357f 100644 --- a/lib/pangea/pages/class_invitation_selection/class_invitation_selection.dart +++ b/lib/pangea/pages/class_invitation_selection/class_invitation_selection.dart @@ -53,7 +53,10 @@ class ClassInvitationSelectionController if (success.error == null) { ScaffoldMessenger.of(context).showSnackBar( SnackBar( - content: Text(L10n.of(context)!.contactHasBeenInvitedToTheGroup), + // #Pangea + // content: Text(L10n.of(context)!.contactHasBeenInvitedToTheGroup), + content: Text(L10n.of(context)!.contactHasBeenInvitedToTheChat), + // Pangea# ), ); } diff --git a/lib/pangea/pages/class_settings/p_class_widgets/room_capacity_button.dart b/lib/pangea/pages/class_settings/p_class_widgets/room_capacity_button.dart index 7be6e8ec3..11452830c 100644 --- a/lib/pangea/pages/class_settings/p_class_widgets/room_capacity_button.dart +++ b/lib/pangea/pages/class_settings/p_class_widgets/room_capacity_button.dart @@ -9,10 +9,13 @@ import 'package:matrix/matrix.dart'; class RoomCapacityButton extends StatefulWidget { final Room? room; final ChatDetailsController? controller; + final bool spaceMode; + const RoomCapacityButton({ super.key, this.room, this.controller, + this.spaceMode = false, }); @override @@ -66,6 +69,15 @@ class RoomCapacityButtonState extends State { } } + 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 Widget build(BuildContext context) { final iconColor = Theme.of(context).textTheme.bodyLarge!.color; @@ -86,7 +98,7 @@ class RoomCapacityButtonState extends State { : '$capacity', ), title: Text( - L10n.of(context)!.roomCapacity, + L10n.of(context)!.roomCapacity(roomType), style: TextStyle( color: Theme.of(context).colorScheme.secondary, fontWeight: FontWeight.bold, @@ -104,8 +116,8 @@ class RoomCapacityButtonState extends State { Future setRoomCapacity() async { final input = await showTextInputDialog( context: context, - title: L10n.of(context)!.roomCapacity, - message: L10n.of(context)!.roomCapacityExplanation, + title: L10n.of(context)!.roomCapacity(roomType), + message: L10n.of(context)!.roomCapacityExplanation(roomType), okLabel: L10n.of(context)!.ok, cancelLabel: L10n.of(context)!.cancel, textFields: [ @@ -121,7 +133,7 @@ class RoomCapacityButtonState extends State { return L10n.of(context)!.enterNumber; } if (nonAdmins != null && int.parse(value) < int.parse(nonAdmins!)) { - return L10n.of(context)!.capacitySetTooLow; + return L10n.of(context)!.capacitySetTooLow(roomType); } return null; }, @@ -147,7 +159,7 @@ class RoomCapacityButtonState extends State { ScaffoldMessenger.of(context).showSnackBar( SnackBar( content: Text( - L10n.of(context)!.roomCapacityHasBeenChanged, + L10n.of(context)!.roomCapacityHasBeenChanged(roomType), ), ), );