i18n support

This commit is contained in:
n4ze3m
2024-03-24 21:00:00 +05:30
parent 3143dd3490
commit 01d27fd1c2
25 changed files with 583 additions and 491 deletions

View File

@@ -14,7 +14,7 @@ dayjs.extend(relativeTime)
export const ModelsBody = () => {
const queryClient = useQueryClient()
const [open, setOpen] = useState(false)
const { t } = useTranslation(["option", "common"])
const { t } = useTranslation(["settings", "common"])
const form = useForm({
initialValues: {

View File

@@ -284,7 +284,7 @@ export const PlaygroundForm = ({ dropedFile }: Props) => {
}`}>
<ImageIcon className="h-5 w-5" />
</button>
</Tooltip>
</Tooltip>
{!isSending ? (
<Dropdown.Button
htmlType="submit"

View File

@@ -27,7 +27,7 @@ export const PromptBody = () => {
const [editId, setEditId] = useState("")
const [createForm] = Form.useForm()
const [editForm] = Form.useForm()
const { t } = useTranslation("option")
const { t } = useTranslation("settings")
const { data, status } = useQuery({
queryKey: ["fetchAllPrompts"],

View File

@@ -16,7 +16,7 @@ import { useTranslation } from "react-i18next"
export const SettingsOllama = () => {
const [ollamaURL, setOllamaURL] = useState<string>("")
const { t } = useTranslation("option")
const { t } = useTranslation("settings")
const { data: ollamaInfo, status } = useQuery({
queryKey: ["fetchOllamURL"],

View File

@@ -16,7 +16,7 @@ export const SettingOther = () => {
const queryClient = useQueryClient()
const { mode, toggleDarkMode } = useDarkMode()
const { t } = useTranslation("option")
const { t } = useTranslation("settings")
const {
changeLocale,
locale,

View File

@@ -12,7 +12,7 @@ import {
} from "~/services/ollama"
export const SettingPrompt = () => {
const { t } = useTranslation("option")
const { t } = useTranslation("settings")
const [selectedValue, setSelectedValue] = React.useState<"normal" | "web">(
"web"

View File

@@ -7,7 +7,7 @@ import {
} from "~/services/ollama"
export const SearchModeSettings = () => {
const { t } = useTranslation("option")
const { t } = useTranslation("settings")
const { data, status } = useQuery({
queryKey: ["fetchIsSimpleInternetSearch"],

View File

@@ -9,7 +9,7 @@ import { verifyPageShareURL } from "~/utils/verify-page-share"
export const OptionShareBody = () => {
const queryClient = useQueryClient()
const { t } = useTranslation("option")
const { t } = useTranslation(["settings"])
const { status, data } = useQuery({
queryKey: ["fetchShareInfo"],
@@ -72,16 +72,12 @@ export const OptionShareBody = () => {
mutationFn: onDelete,
onSuccess: () => {
queryClient.invalidateQueries({
queryKey: ["fetchShareInfo"],
queryKey: ["fetchShareInfo"]
})
message.success(
t("manageShare.notification.webShareDeleteSuccess")
)
message.success(t("manageShare.notification.webShareDeleteSuccess"))
},
onError: (error) => {
message.error(
error?.message || t("manageShare.notification.someError")
)
message.error(error?.message || t("manageShare.notification.someError"))
}
})
@@ -107,7 +103,7 @@ export const OptionShareBody = () => {
name="url"
help={
<Trans
i18nKey="option:manageShare.form.url.help"
i18nKey="settings:manageShare.form.url.help"
components={{
anchor: (
<a