mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-01-24 11:16:12 +01:00
🌍 fix: Enhance i18n Support & Optimize Category Handling (#5866)
* fix: Missing Translations in Prompt Filters in Prompt Library * fix: fixed issue with `zh` feat: added `Estonian` language option * fix: test for `i18n.ts` * refactor: `pt` --> `pt-BR` and `pt-PT` * feat: request access to another language. default is only one language during invite.
This commit is contained in:
parent
52a6de2aa7
commit
04c2a5abe7
33 changed files with 819 additions and 41 deletions
|
|
@ -1,16 +1,16 @@
|
|||
import { useGetCategories } from '~/data-provider';
|
||||
import CategoryIcon from '~/components/Prompts/Groups/CategoryIcon';
|
||||
import useLocalize from '~/hooks/useLocalize';
|
||||
import useLocalize, { TranslationKeys } from '~/hooks/useLocalize';
|
||||
|
||||
const loadingCategories = [
|
||||
const loadingCategories: { label: TranslationKeys; value: string }[] = [
|
||||
{
|
||||
label: 'Loading...',
|
||||
label: 'com_ui_loading',
|
||||
value: '',
|
||||
},
|
||||
] as undefined | { label: string; value: string }[];
|
||||
];
|
||||
|
||||
const emptyCategory = {
|
||||
label: '-',
|
||||
const emptyCategory: { label: TranslationKeys; value: string } = {
|
||||
label: 'com_ui_empty_category',
|
||||
value: '',
|
||||
};
|
||||
|
||||
|
|
@ -19,7 +19,7 @@ const useCategories = (className = '') => {
|
|||
const { data: categories = loadingCategories } = useGetCategories({
|
||||
select: (data) =>
|
||||
data.map((category) => ({
|
||||
label: localize(`com_ui_${category.label}`) || category.label,
|
||||
label: localize(category.label as TranslationKeys),
|
||||
value: category.value,
|
||||
icon: category.value ? (
|
||||
<CategoryIcon category={category.value} className={className} />
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue