mirror of
https://github.com/Yidadaa/ChatGPT-Next-Web.git
synced 2025-09-12 22:06:55 +08:00
feat: 1) Present 'maxtokens' as properties tied to a single model. 2) Remove the original author's implementation of the send verification logic and replace it with a user input validator. Pre-verification 3) Provides the ability to pull the 'User Visible modellist' provided by 'provider' 4) Provider-related parameters are passed in the constructor of 'providerClient'. Not passed in the 'chat' method
This commit is contained in:
19
app/client/common/locale.ts
Normal file
19
app/client/common/locale.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import { Lang, getLang } from "@/app/locales";
|
||||
|
||||
interface PlainConfig {
|
||||
[k: string]: PlainConfig | string;
|
||||
}
|
||||
|
||||
export type LocaleMap<
|
||||
TextPlainConfig extends PlainConfig,
|
||||
Default extends Lang,
|
||||
> = Partial<Record<Lang, TextPlainConfig>> & {
|
||||
[name in Default]: TextPlainConfig;
|
||||
};
|
||||
|
||||
export function getLocaleText<
|
||||
TextPlainConfig extends PlainConfig,
|
||||
DefaultLang extends Lang,
|
||||
>(textMap: LocaleMap<TextPlainConfig, DefaultLang>, defaultLang: DefaultLang) {
|
||||
return textMap[getLang()] || textMap[defaultLang];
|
||||
}
|
Reference in New Issue
Block a user