fix: i18n

This commit is contained in:
Ibrahima G. Coulibaly
2025-07-15 18:30:02 +01:00
parent 5ba8955890
commit bf2668b963
12 changed files with 106 additions and 89 deletions

View File

@@ -9,6 +9,7 @@ import { categoriesColors } from 'config/uiConfig';
import { Icon } from '@iconify/react';
import { useTranslation } from 'react-i18next';
import { getI18nNamespaceFromToolCategory } from '@utils/string';
import { validNamespaces } from '../../i18n';
type ArrayElement<ArrayType extends readonly unknown[]> =
ArrayType extends readonly (infer ElementType)[] ? ElementType : never;
@@ -32,10 +33,10 @@ const SingleCategory = function ({
`categories.${category.type}.description`,
category.description
);
const seeAllText = t('categories.seeAll', 'See all {{title}}', {
const seeAllText = t('translation:categories.seeAll', 'See all {{title}}', {
title: categoryTitle
});
const tryText = t('categories.try', 'Try {{title}}', {
const tryText = t('translation:categories.try', 'Try {{title}}', {
//@ts-ignore
title: t(category.example.title)
});
@@ -111,9 +112,10 @@ const SingleCategory = function ({
);
};
export default function Categories() {
const { t } = useTranslation();
return (
<Grid width={'80%'} container mt={2} spacing={2}>
{getToolsByCategory().map((category, index) => (
{getToolsByCategory(t).map((category, index) => (
<SingleCategory key={category.type} category={category} index={index} />
))}
</Grid>