AgentGPT-Web-GUI / next /src /utils /translations.ts
dia-gov's picture
Upload 569 files
cd6f98e verified
raw
history blame
232 Bytes
import {i18n} from "next-i18next";
type Namespace =
'errors' | 'drawer'
export const translate = (key: string, ns: Namespace | undefined) => {
const opts = !!ns ? { ns } : undefined
return i18n?.t(key, key, opts) ?? key;
}