Files
FastGPT/packages/web/i18n/i18next.ts
T
Archer 2e18f1ebc2 next 15 (#6457)
* next 15

* lock

* feat: rename .d.ts to .ts for Next 15 compatibility

- Rename 104 .d.ts files to .ts (Next 15 no longer supports .d.ts in src)
- Remove 5 redundant .d.ts files that had .ts counterparts
- Update all import paths: remove .d suffix from 100 import statements
- Update tsconfig.json include patterns across all packages
- Add pnpm overrides to unify react@18.3.1 across monorepo
- Fix react version mismatch (packages/global and packages/service were resolving to react@19.1.1)

* fix: resolve 61 TypeScript errors from .d.ts to .ts migration

- Fix broken imports using non-relative module paths (e.g. 'support/user/team/type' → relative paths)
- Remove unused/dead imports referencing deleted modules
- Fix duplicate identifiers (show_emptyChat, concatMd, TrainingModeEnum)
- Add missing imports (BoxProps, GroupMemberRole, UsageSourceEnum, dashboard_evaluation)
- Fix generic type constraints (OutLinkEditType, createShareChat)
- Replace removed types with correct alternatives (ChatModelItemType → LLMModelItemType)
- Delete 5 dead code files with 0 references
- Add global type declaration for countTrackQueue
- Fix nullable type narrowing (sourceMember, ParentIdType, optional app fields)

* refactor: replace as ClientSession assertion with proper type narrowing via Omit & intersection

* fix: remove experimental.workerThreads to fix DataCloneError in Next 15 static generation

Next 15 worker threads attempt to structuredClone the config object,
which fails on the webpack function. workerThreads is not needed for
the build to work correctly.

* Update document/content/docs/upgrading/4-14/4148.mdx

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* fix: ts

* update next config

* update next

* fix: dockerfile

* fix: comment

---------

Co-authored-by: Archer <c121914yu@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-02-25 18:28:16 +08:00

68 lines
2.5 KiB
TypeScript

import 'i18next';
import type account_team from './zh-CN/account_team.json';
import type account from './zh-CN/account.json';
import type account_thirdParty from './zh-CN/account_thirdParty.json';
import type account_promotion from './zh-CN/account_promotion.json';
import type account_inform from './zh-CN/account_inform.json';
import type account_setting from './zh-CN/account_setting.json';
import type account_apikey from './zh-CN/account_apikey.json';
import type account_bill from './zh-CN/account_bill.json';
import type account_usage from './zh-CN/account_usage.json';
import type account_info from './zh-CN/account_info.json';
import type common from './zh-CN/common.json';
import type dataset from './zh-CN/dataset.json';
import type app from './zh-CN/app.json';
import type file from './zh-CN/file.json';
import type publish from './zh-CN/publish.json';
import type workflow from './zh-CN/workflow.json';
import type user from './zh-CN/user.json';
import type chat from './zh-CN/chat.json';
import type login from './zh-CN/login.json';
import type account_model from './zh-CN/account_model.json';
import type dashboard_mcp from './zh-CN/dashboard_mcp.json';
import type dashboard_evaluation from './zh-CN/dashboard_evaluation.json';
import type { I18N_NAMESPACES } from './constants';
export interface I18nNamespaces {
common: typeof common;
dataset: typeof dataset;
app: typeof app;
file: typeof file;
publish: typeof publish;
workflow: typeof workflow;
user: typeof user;
chat: typeof chat;
login: typeof login;
account_info: typeof account_info;
account_usage: typeof account_usage;
account_bill: typeof account_bill;
account_apikey: typeof account_apikey;
account_setting: typeof account_setting;
account_inform: typeof account_inform;
account_promotion: typeof account_promotion;
account: typeof account;
account_team: typeof account_team;
account_thirdParty: typeof account_thirdParty;
account_model: typeof account_model;
dashboard_mcp: typeof dashboard_mcp;
dashboard_evaluation: typeof dashboard_evaluation;
}
export type I18nNsType = (keyof I18nNamespaces)[];
export type ParseKeys<Ns extends keyof I18nNamespaces = keyof I18nNamespaces> = {
[K in Ns]: `${K}:${keyof I18nNamespaces[K] & string}`;
}[Ns];
export type I18nKeyFunction = {
<Key extends ParseKeys>(key: Key): Key;
};
declare module 'i18next' {
interface CustomTypeOptions {
returnNull: false;
defaultNS: typeof I18N_NAMESPACES;
resources: I18nNamespaces;
}
}