diff --git a/src/assets/locale/fa/settings.json b/src/assets/locale/fa/settings.json index 0cbafdc..02098b6 100644 --- a/src/assets/locale/fa/settings.json +++ b/src/assets/locale/fa/settings.json @@ -147,6 +147,10 @@ "type": "نوع پرامپت", "actions": "اقدامات" }, + "segmented": { + "custom": "پرامپت‌های سفارشی", + "copilot": "پرامپت‌های کوپایلوت" + }, "systemPrompt": "پرامپت سیستم ", "quickPrompt": "پرامپت سریع", "tooltip": { diff --git a/src/entries/options/App.tsx b/src/entries/options/App.tsx index b385df8..997e1de 100644 --- a/src/entries/options/App.tsx +++ b/src/entries/options/App.tsx @@ -1,6 +1,6 @@ import { QueryClient, QueryClientProvider } from "@tanstack/react-query" import { MemoryRouter } from "react-router-dom" -import { useEffect } from "react" +import { useEffect, useState } from "react" const queryClient = new QueryClient() import { ConfigProvider, Empty, theme } from "antd" import { StyleProvider } from "@ant-design/cssinjs" @@ -13,13 +13,15 @@ import { PageAssistProvider } from "@/components/Common/PageAssistProvider" function IndexOption() { const { mode } = useDarkMode() const { t, i18n } = useTranslation() + const [direction, setDirection] = useState<"ltr" | "rtl">("ltr") useEffect(() => { if (i18n.resolvedLanguage) { - document.documentElement.lang = i18n.resolvedLanguage; - document.documentElement.dir = i18n.dir(i18n.resolvedLanguage); + document.documentElement.lang = i18n.resolvedLanguage + document.documentElement.dir = i18n.dir(i18n.resolvedLanguage) + setDirection(i18n.dir(i18n.resolvedLanguage)) } - }, [i18n, i18n.resolvedLanguage]); + }, [i18n, i18n.resolvedLanguage]) return ( @@ -38,7 +40,8 @@ function IndexOption() { }} description={t("common:noData")} /> - )}> + )} + direction={direction}> diff --git a/src/services/title.ts b/src/services/title.ts index c7a9cd4..ac4b8e8 100644 --- a/src/services/title.ts +++ b/src/services/title.ts @@ -14,7 +14,7 @@ export const DEFAULT_TITLE_GEN_PROMPT = `Here is the query: -------------- -Create a concise, 3-5 word phrase as a title for the previous query. Suitable emojis for the summary can be used to enhance understanding. Avoid quotation marks or special formatting. RESPOND ONLY WITH THE TITLE TEXT. ANSWER USING THE SAME LANGUAGE AS THE QUERY. +Create a concise, 3-5 word phrase as a title for the previous query. Avoid quotation marks or special formatting. RESPOND ONLY WITH THE TITLE TEXT. ANSWER USING THE SAME LANGUAGE AS THE QUERY. Examples of titles: