From d0ddcfea6a2adf177ea044a75cdbd0bacecab86d Mon Sep 17 00:00:00 2001 From: Ayaka Date: Thu, 3 Aug 2023 22:29:03 +0800 Subject: [PATCH] Rename "Save & Submit" to "Generate" (#396) * Rename to generate * edit view buttons reorder buttons and colors --------- Co-authored-by: Jing Hua Co-authored-by: Jing Hua <59118459+ztjhz@users.noreply.github.com> --- public/locales/da/main.json | 2 +- public/locales/de/main.json | 2 +- public/locales/en-US/main.json | 2 +- public/locales/en/main.json | 2 +- public/locales/es/main.json | 2 +- public/locales/fr/main.json | 2 +- public/locales/it/main.json | 2 +- public/locales/ja/main.json | 2 +- public/locales/ms/main.json | 2 +- public/locales/nb/main.json | 2 +- public/locales/ro/main.json | 2 +- public/locales/ru/main.json | 2 +- public/locales/sv/main.json | 2 +- public/locales/zh-CN/main.json | 2 +- public/locales/zh-HK/main.json | 2 +- public/locales/zh-TW/main.json | 2 +- .../ChatContent/Message/View/EditView.tsx | 49 +++++++++---------- 17 files changed, 40 insertions(+), 41 deletions(-) diff --git a/public/locales/da/main.json b/public/locales/da/main.json index ef8d0d5..32f6bdf 100644 --- a/public/locales/da/main.json +++ b/public/locales/da/main.json @@ -1,6 +1,6 @@ { "save": "Gem", - "saveAndSubmit": "Gem & Send", + "generate": "Generere", "cancel": "Annuller", "confirm": "Bekræft", "warning": "Advarsel", diff --git a/public/locales/de/main.json b/public/locales/de/main.json index dc430e9..aed45e8 100644 --- a/public/locales/de/main.json +++ b/public/locales/de/main.json @@ -1,6 +1,6 @@ { "save": "Speichern", - "saveAndSubmit": "Speichern & Absenden", + "generate": "Generieren", "cancel": "Abbrechen", "confirm": "Bestätigen", "warning": "Achtung", diff --git a/public/locales/en-US/main.json b/public/locales/en-US/main.json index 3b7f25c..04855d1 100644 --- a/public/locales/en-US/main.json +++ b/public/locales/en-US/main.json @@ -1,6 +1,6 @@ { "save": "Save", - "saveAndSubmit": "Save & Submit", + "generate": "Generate", "cancel": "Cancel", "confirm": "Confirm", "warning": "Warning", diff --git a/public/locales/en/main.json b/public/locales/en/main.json index 3b7f25c..04855d1 100644 --- a/public/locales/en/main.json +++ b/public/locales/en/main.json @@ -1,6 +1,6 @@ { "save": "Save", - "saveAndSubmit": "Save & Submit", + "generate": "Generate", "cancel": "Cancel", "confirm": "Confirm", "warning": "Warning", diff --git a/public/locales/es/main.json b/public/locales/es/main.json index b3666fe..5b4dd3e 100644 --- a/public/locales/es/main.json +++ b/public/locales/es/main.json @@ -1,6 +1,6 @@ { "save": "Guardar", - "saveAndSubmit": "Guardar y enviar", + "generate": "Generar", "cancel": "Cancelar", "confirm": "Aceptar", "warning": "Aviso", diff --git a/public/locales/fr/main.json b/public/locales/fr/main.json index e017a63..38e7af2 100644 --- a/public/locales/fr/main.json +++ b/public/locales/fr/main.json @@ -1,6 +1,6 @@ { "save": "Enregistrer", - "saveAndSubmit": "Enregistrer et Soumettre", + "generate": "Générer", "cancel": "Annuler", "confirm": "Confirmer", "warning": "Attention", diff --git a/public/locales/it/main.json b/public/locales/it/main.json index 00f1001..241b573 100644 --- a/public/locales/it/main.json +++ b/public/locales/it/main.json @@ -1,6 +1,6 @@ { "save": "Salva", - "saveAndSubmit": "Salva & Invia", + "generate": "Generare", "cancel": "Annulla", "confirm": "Conferma", "warning": "Attenzione", diff --git a/public/locales/ja/main.json b/public/locales/ja/main.json index b8c153e..374f674 100644 --- a/public/locales/ja/main.json +++ b/public/locales/ja/main.json @@ -1,6 +1,6 @@ { "save": "保存", - "saveAndSubmit": "保存して送信", + "generate": "生成", "cancel": "キャンセル", "confirm": "確認", "warning": "警告", diff --git a/public/locales/ms/main.json b/public/locales/ms/main.json index 26f7e53..86b8b9a 100644 --- a/public/locales/ms/main.json +++ b/public/locales/ms/main.json @@ -1,6 +1,6 @@ { "save": "Simpan", - "saveAndSubmit": "Simpan & Hantar", + "generate": "Hasilkan", "cancel": "Batal", "confirm": "Sahkan", "warning": "Amaran", diff --git a/public/locales/nb/main.json b/public/locales/nb/main.json index 462828e..2a7cfe5 100644 --- a/public/locales/nb/main.json +++ b/public/locales/nb/main.json @@ -1,6 +1,6 @@ { "save": "Lagre", - "saveAndSubmit": "Lagre & Send inn", + "generate": "Generere", "cancel": "Avbryt", "confirm": "Bekreft", "warning": "Advarsel", diff --git a/public/locales/ro/main.json b/public/locales/ro/main.json index 50dbcf7..c5abd5e 100644 --- a/public/locales/ro/main.json +++ b/public/locales/ro/main.json @@ -1,6 +1,6 @@ { "save": "Salvează", - "saveAndSubmit": "Salvați și trimiteți", + "generate": "Generează", "cancel": "Anulează", "confirm": "Confirmați", "warning": "Avertisment", diff --git a/public/locales/ru/main.json b/public/locales/ru/main.json index 39c8e84..119b395 100644 --- a/public/locales/ru/main.json +++ b/public/locales/ru/main.json @@ -1,6 +1,6 @@ { "save": "Сохранить", - "saveAndSubmit": "Сохранить и отправить", + "generate": "Генерировать", "cancel": "Отмена", "confirm": "Подтвердить", "warning": "Предупреждение", diff --git a/public/locales/sv/main.json b/public/locales/sv/main.json index a5a1283..b47d0f1 100644 --- a/public/locales/sv/main.json +++ b/public/locales/sv/main.json @@ -1,6 +1,6 @@ { "save": "Spara", - "saveAndSubmit": "Spara & Skicka in", + "generate": "Generera", "cancel": "Avbryt", "confirm": "Bekräfta", "warning": "Varning", diff --git a/public/locales/zh-CN/main.json b/public/locales/zh-CN/main.json index 65a3d7b..61ced53 100644 --- a/public/locales/zh-CN/main.json +++ b/public/locales/zh-CN/main.json @@ -1,6 +1,6 @@ { "save": "保存", - "saveAndSubmit": "保存并提交", + "generate": "生成", "cancel": "取消", "confirm": "确认", "warning": "警告", diff --git a/public/locales/zh-HK/main.json b/public/locales/zh-HK/main.json index dc4125b..39ce36a 100644 --- a/public/locales/zh-HK/main.json +++ b/public/locales/zh-HK/main.json @@ -1,6 +1,6 @@ { "save": "儲存", - "saveAndSubmit": "儲存並提交", + "generate": "生成", "cancel": "取消", "confirm": "確認", "warning": "警告", diff --git a/public/locales/zh-TW/main.json b/public/locales/zh-TW/main.json index 20696de..cf8670b 100644 --- a/public/locales/zh-TW/main.json +++ b/public/locales/zh-TW/main.json @@ -1,6 +1,6 @@ { "save": "儲存", - "saveAndSubmit": "儲存並提交", + "generate": "生成", "cancel": "取消", "confirm": "確認", "warning": "警告", diff --git a/src/components/Chat/ChatContent/Message/View/EditView.tsx b/src/components/Chat/ChatContent/Message/View/EditView.tsx index 656e7ba..e0d9503 100644 --- a/src/components/Chat/ChatContent/Message/View/EditView.tsx +++ b/src/components/Chat/ChatContent/Message/View/EditView.tsx @@ -46,7 +46,7 @@ const EditView = ({ if (e.ctrlKey && e.shiftKey) { e.preventDefault(); - handleSaveAndSubmit(); + handleGenerate(); resetTextAreaHeight(); } else if ( (enterToSubmit && !e.shiftKey) || @@ -54,7 +54,7 @@ const EditView = ({ ) { if (sticky) { e.preventDefault(); - handleSaveAndSubmit(); + handleGenerate(); resetTextAreaHeight(); } else { handleSave(); @@ -81,7 +81,7 @@ const EditView = ({ }; const { handleSubmit } = useSubmit(); - const handleSaveAndSubmit = () => { + const handleGenerate = () => { if (useStore.getState().generating) return; const updatedChats: ChatInterface[] = JSON.parse( JSON.stringify(useStore.getState().chats) @@ -142,7 +142,7 @@ const EditView = ({ )} @@ -163,14 +163,14 @@ const EditView = ({ const EditViewButtons = memo( ({ sticky = false, - handleSaveAndSubmit, + handleGenerate, handleSave, setIsModalOpen, setIsEdit, _setContent, }: { sticky?: boolean; - handleSaveAndSubmit: () => void; + handleGenerate: () => void; handleSave: () => void; setIsModalOpen: React.Dispatch>; setIsEdit: React.Dispatch>; @@ -188,11 +188,24 @@ const EditViewButtons = memo( className={`btn relative mr-2 btn-primary ${ generating ? 'cursor-not-allowed opacity-40' : '' }`} - onClick={handleSaveAndSubmit} - aria-label={t('saveAndSubmit') as string} + onClick={handleGenerate} + aria-label={t('generate') as string} >
- {t('saveAndSubmit')} + {t('generate')} +
+ + )} + + {sticky || ( + )} @@ -203,7 +216,7 @@ const EditViewButtons = memo( ? `btn-neutral ${ generating ? 'cursor-not-allowed opacity-40' : '' }` - : 'btn-primary' + : 'btn-neutral' }`} onClick={handleSave} aria-label={t('save') as string} @@ -213,20 +226,6 @@ const EditViewButtons = memo( - {sticky || ( - - )} - {sticky || (