From dd5bc7808c6cb74528e0a1ac97af8bb67574a1df Mon Sep 17 00:00:00 2001 From: Daniyar Nurmukhamet Date: Mon, 15 May 2023 15:01:37 +0600 Subject: [PATCH] feature: added making text longer (#2532) * feature: added making text longer * fix: corrected I10n --- frontend/appflowy_flutter/assets/translations/en.json | 5 +++-- .../plugins/openai/widgets/smart_edit_action.dart | 11 ++++++++++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/frontend/appflowy_flutter/assets/translations/en.json b/frontend/appflowy_flutter/assets/translations/en.json index c8b5f74215..f394542eee 100644 --- a/frontend/appflowy_flutter/assets/translations/en.json +++ b/frontend/appflowy_flutter/assets/translations/en.json @@ -363,7 +363,8 @@ "smartEditFixSpelling": "Fix spelling", "warning": "⚠️ AI responses can be inaccurate or misleading.", "smartEditSummarize": "Summarize", - "smartEditImproveWriting": "Improve Writing", + "smartEditImproveWriting": "Improve writing", + "smartEditMakeLonger": "Make longer", "smartEditCouldNotFetchResult": "Could not fetch result from OpenAI", "smartEditCouldNotFetchKey": "Could not fetch OpenAI key", "smartEditDisabled": "Connect OpenAI in Settings", @@ -423,4 +424,4 @@ "emptyNoDate": "No unscheduled events" } } -} \ No newline at end of file +} diff --git a/frontend/appflowy_flutter/lib/plugins/document/presentation/plugins/openai/widgets/smart_edit_action.dart b/frontend/appflowy_flutter/lib/plugins/document/presentation/plugins/openai/widgets/smart_edit_action.dart index 2e4a05b87b..9c67de7493 100644 --- a/frontend/appflowy_flutter/lib/plugins/document/presentation/plugins/openai/widgets/smart_edit_action.dart +++ b/frontend/appflowy_flutter/lib/plugins/document/presentation/plugins/openai/widgets/smart_edit_action.dart @@ -6,7 +6,8 @@ import 'package:easy_localization/easy_localization.dart'; enum SmartEditAction { summarize, fixSpelling, - improveWriting; + improveWriting, + makeItLonger; String get toInstruction { switch (this) { @@ -16,6 +17,8 @@ enum SmartEditAction { return 'Correct this to standard English:'; case SmartEditAction.improveWriting: return 'Rewrite this in your own words:'; + case SmartEditAction.makeItLonger: + return 'Make this text longer:'; } } @@ -27,6 +30,8 @@ enum SmartEditAction { return 'Correct this to standard English:\n\n$input'; case SmartEditAction.improveWriting: return 'Rewrite this:\n\n$input'; + case SmartEditAction.makeItLonger: + return 'Make this text longer:\n\n$input'; } } @@ -38,6 +43,8 @@ enum SmartEditAction { return SmartEditAction.fixSpelling; case 2: return SmartEditAction.improveWriting; + case 3: + return SmartEditAction.makeItLonger; } return SmartEditAction.fixSpelling; } @@ -50,6 +57,8 @@ enum SmartEditAction { return LocaleKeys.document_plugins_smartEditFixSpelling.tr(); case SmartEditAction.improveWriting: return LocaleKeys.document_plugins_smartEditImproveWriting.tr(); + case SmartEditAction.makeItLonger: + return LocaleKeys.document_plugins_smartEditMakeLonger.tr(); } } }