From b63ae8c43d873148e7215eb16ba3eb36ff032d8a Mon Sep 17 00:00:00 2001 From: ggurdin Date: Wed, 11 Sep 2024 10:27:03 -0400 Subject: [PATCH 1/2] updated copy to always call chat 'chats' (insteads of groups) --- assets/l10n/intl_en.arb | 8 ++++++-- lib/pages/chat_list/chat_list.dart | 5 ++++- lib/pages/chat_list/chat_list_item.dart | 5 ++++- lib/pages/chat_list/space_view.dart | 15 ++++++++++++--- .../invitation_selection.dart | 5 ++++- lib/pages/new_group/new_group_view.dart | 10 ++++++++-- .../new_private_chat/new_private_chat_view.dart | 5 ++++- .../class_invitation_selection.dart | 5 ++++- 8 files changed, 46 insertions(+), 12 deletions(-) diff --git a/assets/l10n/intl_en.arb b/assets/l10n/intl_en.arb index 9bd5cdd2e..667d21873 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", @@ -4195,5 +4195,9 @@ "discoverHomeservers": "Discover homeservers", "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?" + "doesNotSeemToBeAValidHomeserver": "Doesn't seem to be a compatible homeserver. Wrong URL?", + "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 065f9c9e8..5a84541d8 100644 --- a/lib/pages/chat_list/chat_list.dart +++ b/lib/pages/chat_list/chat_list.dart @@ -138,8 +138,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/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# ), ); } From a32eb15df7c7306ac463a7c6054dcd7daf235629 Mon Sep 17 00:00:00 2001 From: ggurdin Date: Wed, 11 Sep 2024 10:43:26 -0400 Subject: [PATCH 2/2] updated capacity copy to correspond with room type (chat or space) --- assets/l10n/intl_en.arb | 35 ++++++++++++++++--- lib/pages/new_space/new_space_view.dart | 1 + .../p_class_widgets/room_capacity_button.dart | 22 +++++++++--- 3 files changed, 48 insertions(+), 10 deletions(-) diff --git a/assets/l10n/intl_en.arb b/assets/l10n/intl_en.arb index e3ff06b16..ba07fea9f 100644 --- a/assets/l10n/intl_en.arb +++ b/assets/l10n/intl_en.arb @@ -4041,14 +4041,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", @@ -4129,5 +4153,6 @@ "error520Title": "Please try again.", "error520Desc": "Sorry, we could not understand your message...", "translationChoicesBody": "Click and hold an option for a hint.", - "sendCanceled": "Sending canceled" + "sendCanceled": "Sending canceled", + "space": "Space" } \ No newline at end of file diff --git a/lib/pages/new_space/new_space_view.dart b/lib/pages/new_space/new_space_view.dart index 9ef9c9849..7996def21 100644 --- a/lib/pages/new_space/new_space_view.dart +++ b/lib/pages/new_space/new_space_view.dart @@ -115,6 +115,7 @@ class NewSpaceView extends StatelessWidget { RoomCapacityButton( key: controller.addCapacityKey, + spaceMode: true, ), // commenting out language settings in spaces for now // LanguageSettings( 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), ), ), );