i18n support
This commit is contained in:
@@ -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: {
|
||||
|
||||
@@ -284,7 +284,7 @@ export const PlaygroundForm = ({ dropedFile }: Props) => {
|
||||
}`}>
|
||||
<ImageIcon className="h-5 w-5" />
|
||||
</button>
|
||||
</Tooltip>
|
||||
</Tooltip>
|
||||
{!isSending ? (
|
||||
<Dropdown.Button
|
||||
htmlType="submit"
|
||||
|
||||
@@ -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"],
|
||||
|
||||
@@ -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"],
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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"],
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user