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

@@ -2,6 +2,7 @@ import { UpdateField } from '@components/options/ToolOptions';
import { getToolsByCategory } from '@tools/index';
import { ToolCategory } from '@tools/defineTool';
import { I18nNamespaces, validNamespaces } from '../i18n';
import { TFunction } from 'i18next';
// Here starting the shared values for string manipulation.
@@ -109,8 +110,11 @@ export function itemCounter(
return dict;
}
export const getToolCategoryTitle = (categoryName: string): string =>
getToolsByCategory().find((category) => category.type === categoryName)!
export const getToolCategoryTitle = (
categoryName: string,
t: TFunction<I18nNamespaces[]>
): string =>
getToolsByCategory(t).find((category) => category.type === categoryName)!
.rawTitle;
// Type guard to check if a value is a valid I18nNamespaces