UNPKG

@oxyhq/services

Version:

OxyHQ Expo/React Native SDK — UI components, screens, and native features

13 lines (10 loc) 395 B
import { useMemo } from 'react'; import { useOxy } from '../context/OxyContext'; import { translate } from '@oxyhq/core'; export function useI18n() { const { currentLanguage } = useOxy(); const t = useMemo(() => { return (key: string, vars?: Record<string, string | number>) => translate(currentLanguage, key, vars); }, [currentLanguage]); return { t, locale: currentLanguage }; }