Files
readest/apps/readest-app/src/hooks/useTranslation.ts
T
Huang Xin 751bf3836c Disable app updater for app store version and support more languages (#202)
* Disable app updater for app store version

* Add translations for uk, pl and hi
2025-01-20 17:14:26 +01:00

11 lines
391 B
TypeScript

import '@/i18n/i18n';
import { useTranslation as _useTranslation } from 'react-i18next';
export type TranslationFunc = (key: string, options?: Record<string, number | string>) => string;
export const useTranslation = (namespace: string = 'translation') => {
const { t } = _useTranslation(namespace);
return (key: string, options = {}) => t(key, { defaultValue: key, ...options });
};