From 7b4e31ecc47d7b3632fe9a98aad01454ff5616a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=AD=20Santos?= <140329135+itzraiss@users.noreply.github.com> Date: Tue, 16 Jan 2024 15:15:39 -0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8:=20Updated=20Plugins=20Search=20Ba?= =?UTF-8?q?r;=20=F0=9F=8C=8E:=20Added=20Translations=20(#1549)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 🎨: layout search bar plugins: updated / 🌎: translation update * 🌎:Update Portuguese Translation * fix: Refactored 'pluginstoredialog' code. * chore(PopoverButtons): remove comments, re-organize imports * chore: linting and reorganize useState declarations * chore: linting and reorganize useState declarations --------- Co-authored-by: Danny Avila <110412045+danny-avila@users.noreply.github.com> Co-authored-by: Danny Avila --- .../components/Chat/Input/PopoverButtons.tsx | 10 ++- .../Plugins/Store/PluginStoreDialog.tsx | 42 +++++------- client/src/localization/languages/Br.tsx | 64 +++++++++++++------ client/src/localization/languages/Eng.tsx | 5 +- 4 files changed, 70 insertions(+), 51 deletions(-) diff --git a/client/src/components/Chat/Input/PopoverButtons.tsx b/client/src/components/Chat/Input/PopoverButtons.tsx index ce053648d..133638b23 100644 --- a/client/src/components/Chat/Input/PopoverButtons.tsx +++ b/client/src/components/Chat/Input/PopoverButtons.tsx @@ -3,6 +3,7 @@ import type { ReactNode } from 'react'; import { MessagesSquared, GPTIcon } from '~/components/svg'; import { useChatContext } from '~/Providers'; import { Button } from '~/components/ui'; +import { useLocalize } from '~/hooks'; import { cn } from '~/utils/'; type TPopoverButton = { @@ -26,6 +27,7 @@ export default function PopoverButtons({ showAgentSettings, setShowAgentSettings, } = useChatContext(); + const localize = useLocalize(); const { model, endpoint: _endpoint, endpointType } = conversation ?? {}; const endpoint = endpointType ?? _endpoint; @@ -42,7 +44,7 @@ export default function PopoverButtons({ const buttons: { [key: string]: TPopoverButton[] } = { [EModelEndpoint.google]: [ { - label: (showExamples ? 'Hide' : 'Show') + ' Examples', + label: localize(showExamples ? 'com_hide_examples' : 'com_show_examples'), buttonClass: isGenerativeModel || isTextModel ? 'disabled' : '', handler: triggerExamples, icon: , @@ -50,7 +52,9 @@ export default function PopoverButtons({ ], [EModelEndpoint.gptPlugins]: [ { - label: `Show ${showAgentSettings ? 'Completion' : 'Agent'} Settings`, + label: localize( + showAgentSettings ? 'com_show_completion_settings' : 'com_show_agent_settings', + ), buttonClass: '', handler: () => setShowAgentSettings((prev) => !prev), icon: , @@ -71,7 +75,7 @@ export default function PopoverButtons({
{endpointButtons.map((button, index) => (