mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-10-21 01:22:54 +00:00
⚙️ refactor: Lazy load locale resources (#13640)
This commit is contained in:
parent
56608739f8
commit
db863e75e3
13 changed files with 651 additions and 167 deletions
|
|
@ -1,9 +1,8 @@
|
|||
import { useCallback } from 'react';
|
||||
import { TOptions } from 'i18next';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { resources } from '~/locales/i18n';
|
||||
|
||||
export type TranslationKeys = keyof typeof resources.en.translation;
|
||||
export type TranslationKeys = string;
|
||||
|
||||
/** Language lifecycle is managed by the host app — do not add i18n.changeLanguage() calls here. */
|
||||
export default function useLocalize(): (phraseKey: TranslationKeys, options?: TOptions) => string {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue