mirror of
https://github.com/iib0011/omni-tools.git
synced 2025-12-29 16:16:02 +00:00
fix: i18n
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user