mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2025-11-16 09:41:31 +10:00
fix(i18n): add missing translation keys, update lang/locale logic
This commit is contained in:
@ -1,14 +1,19 @@
|
||||
import dayjs from 'dayjs';
|
||||
import relativeTime from 'dayjs/plugin/relativeTime';
|
||||
import { useRouter } from 'next/router';
|
||||
import { useEffect } from 'react';
|
||||
|
||||
const DateWrapper: React.FC = ({ children }) => {
|
||||
const { locale } = useRouter();
|
||||
|
||||
useEffect(() => {
|
||||
dayjs.extend(relativeTime);
|
||||
|
||||
// Locales
|
||||
require('dayjs/locale/kn');
|
||||
}, []);
|
||||
|
||||
locale && dayjs.locale(locale);
|
||||
}, [locale]);
|
||||
|
||||
return <>{children}</>;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user