mirror of
https://github.com/labring/FastGPT.git
synced 2025-12-25 20:02:47 +00:00
fix: ns (#5211)
Some checks are pending
Build FastGPT images in Personal warehouse / get-vars (push) Waiting to run
Build FastGPT images in Personal warehouse / build-fastgpt-images (map[arch:amd64 runs-on:ubuntu-24.04]) (push) Blocked by required conditions
Build FastGPT images in Personal warehouse / build-fastgpt-images (map[arch:arm64 runs-on:ubuntu-24.04-arm]) (push) Blocked by required conditions
Build FastGPT images in Personal warehouse / release-fastgpt-images (push) Blocked by required conditions
Some checks are pending
Build FastGPT images in Personal warehouse / get-vars (push) Waiting to run
Build FastGPT images in Personal warehouse / build-fastgpt-images (map[arch:amd64 runs-on:ubuntu-24.04]) (push) Blocked by required conditions
Build FastGPT images in Personal warehouse / build-fastgpt-images (map[arch:arm64 runs-on:ubuntu-24.04-arm]) (push) Blocked by required conditions
Build FastGPT images in Personal warehouse / release-fastgpt-images (push) Blocked by required conditions
This commit is contained in:
parent
f648011ff0
commit
885a419178
|
|
@ -1,14 +1,14 @@
|
|||
import { useTranslation as useNextTranslation } from 'next-i18next';
|
||||
import type { I18nNsType } from '../i18n/i18next';
|
||||
import { I18N_NAMESPACES_MAP } from '../i18n/constants';
|
||||
|
||||
export function useTranslation(ns?: I18nNsType[0] | I18nNsType) {
|
||||
const { t: originalT, ...rest } = useNextTranslation(ns);
|
||||
export function useTranslation() {
|
||||
const { t: originalT, ...rest } = useNextTranslation();
|
||||
|
||||
const t = (key: string | undefined, ...args: any[]): string => {
|
||||
if (!key) return '';
|
||||
|
||||
if (!I18N_NAMESPACES_MAP[key as any]) {
|
||||
const ns = key.split(':')[0];
|
||||
if (!I18N_NAMESPACES_MAP[ns as any]) {
|
||||
return key;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -277,11 +277,12 @@ const NodeTemplateList = ({
|
|||
.map((input) => ({
|
||||
...input,
|
||||
value: defaultValueMap[input.key] ?? input.value ?? input.defaultValue,
|
||||
valueDesc: t(input.valueDesc as any),
|
||||
valueDesc: input.valueDesc ? t(input.valueDesc as any) : undefined,
|
||||
label: t(input.label as any),
|
||||
description: t(input.description as any),
|
||||
debugLabel: t(input.debugLabel as any),
|
||||
toolDescription: t(input.toolDescription as any)
|
||||
description: input.description ? t(input.description as any) : undefined,
|
||||
placeholder: input.placeholder ? t(input.placeholder as any) : undefined,
|
||||
debugLabel: input.debugLabel ? t(input.debugLabel as any) : undefined,
|
||||
toolDescription: input.toolDescription ? t(input.toolDescription as any) : undefined
|
||||
})),
|
||||
outputs: templateNode.outputs
|
||||
.filter((output) => output.deprecated !== true)
|
||||
|
|
|
|||
Loading…
Reference in New Issue