File size: 310 Bytes
9705b6c
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
import { useRecoilValue } from 'recoil';
import { localize } from '~/localization/Translation';
import store from '~/store';

export default function useLocalize() {
  const lang = useRecoilValue(store.lang);
  return (phraseKey: string, ...values: string[]) => localize(lang, phraseKey, ...(values ?? []));
}