From 0836a5c8625713d021a7d3c57b1dabcadcad198f Mon Sep 17 00:00:00 2001 From: krille-chan Date: Sun, 13 Aug 2023 08:07:03 +0200 Subject: [PATCH] refactor: Change group description to chat description --- assets/l10n/intl_en.arb | 26 ++++--------------- lib/pages/chat_details/chat_details.dart | 6 ++--- lib/pages/chat_details/chat_details_view.dart | 7 +++-- lib/widgets/public_room_bottom_sheet.dart | 2 +- 4 files changed, 12 insertions(+), 29 deletions(-) diff --git a/assets/l10n/intl_en.arb b/assets/l10n/intl_en.arb index 2324b73d..a84ec657 100644 --- a/assets/l10n/intl_en.arb +++ b/assets/l10n/intl_en.arb @@ -76,11 +76,7 @@ "mxid": {} } }, - "addGroupDescription": "Add a group description", - "@addGroupDescription": { - "type": "text", - "placeholders": {} - }, + "addChatDescription": "Add a chat description", "addToSpace": "Add to space", "@addToSpace": {}, "admin": "Admin", @@ -922,16 +918,8 @@ "type": "text", "placeholders": {} }, - "groupDescription": "Group description", - "@groupDescription": { - "type": "text", - "placeholders": {} - }, - "groupDescriptionHasBeenChanged": "Group description changed", - "@groupDescriptionHasBeenChanged": { - "type": "text", - "placeholders": {} - }, + "chatDescription": "Chat description", + "chatDescriptionHasBeenChanged": "Chat description changed", "groupIsPublic": "Group is public", "@groupIsPublic": { "type": "text", @@ -1052,7 +1040,7 @@ "groupName": {} } }, - "noGroupDescriptionYet": "No group description created yet.", + "noChatDescriptionYet": "No chat description created yet.", "anyoneCanKnock": "Anyone can knock", "noOneCanJoin": "No one can join", "tryAgain": "Try again", @@ -1835,11 +1823,7 @@ "type": "text", "placeholders": {} }, - "setGroupDescription": "Set group description", - "@setGroupDescription": { - "type": "text", - "placeholders": {} - }, + "setChatDescription": "Set chat description", "setInvitationLink": "Set invitation link", "@setInvitationLink": { "type": "text", diff --git a/lib/pages/chat_details/chat_details.dart b/lib/pages/chat_details/chat_details.dart index 795ab9c4..fd70ac58 100644 --- a/lib/pages/chat_details/chat_details.dart +++ b/lib/pages/chat_details/chat_details.dart @@ -199,12 +199,12 @@ class ChatDetailsController extends State { final room = Matrix.of(context).client.getRoomById(roomId!)!; final input = await showTextInputDialog( context: context, - title: L10n.of(context)!.setGroupDescription, + title: L10n.of(context)!.setChatDescription, okLabel: L10n.of(context)!.ok, cancelLabel: L10n.of(context)!.cancel, textFields: [ DialogTextField( - hintText: L10n.of(context)!.noGroupDescriptionYet, + hintText: L10n.of(context)!.noChatDescriptionYet, initialText: room.topic, minLines: 4, maxLines: 8, @@ -219,7 +219,7 @@ class ChatDetailsController extends State { if (success.error == null) { ScaffoldMessenger.of(context).showSnackBar( SnackBar( - content: Text(L10n.of(context)!.groupDescriptionHasBeenChanged), + content: Text(L10n.of(context)!.chatDescriptionHasBeenChanged), ), ); } diff --git a/lib/pages/chat_details/chat_details_view.dart b/lib/pages/chat_details/chat_details_view.dart index 8a8c63cf..c3aebb23 100644 --- a/lib/pages/chat_details/chat_details_view.dart +++ b/lib/pages/chat_details/chat_details_view.dart @@ -210,7 +210,7 @@ class ChatDetailsView extends StatelessWidget { if (!room.canChangeStateEvent(EventTypes.RoomTopic)) ListTile( title: Text( - L10n.of(context)!.groupDescription, + L10n.of(context)!.chatDescription, style: TextStyle( color: Theme.of(context).colorScheme.secondary, fontWeight: FontWeight.bold, @@ -222,8 +222,7 @@ class ChatDetailsView extends StatelessWidget { padding: const EdgeInsets.all(16.0), child: OutlinedButton.icon( onPressed: controller.setTopicAction, - label: - Text(L10n.of(context)!.setGroupDescription), + label: Text(L10n.of(context)!.setChatDescription), icon: const Icon(Icons.edit_outlined), ), ), @@ -233,7 +232,7 @@ class ChatDetailsView extends StatelessWidget { ), child: SelectableLinkify( text: room.topic.isEmpty - ? L10n.of(context)!.noGroupDescriptionYet + ? L10n.of(context)!.noChatDescriptionYet : room.topic, options: const LinkifyOptions(humanize: false), linkStyle: diff --git a/lib/widgets/public_room_bottom_sheet.dart b/lib/widgets/public_room_bottom_sheet.dart index 645e13a3..818afd17 100644 --- a/lib/widgets/public_room_bottom_sheet.dart +++ b/lib/widgets/public_room_bottom_sheet.dart @@ -147,7 +147,7 @@ class PublicRoomBottomSheet extends StatelessWidget { if (profile?.topic?.isNotEmpty ?? false) ListTile( title: Text( - L10n.of(context)!.groupDescription, + L10n.of(context)!.chatDescription, style: TextStyle( color: Theme.of(context).colorScheme.secondary, ),