mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2025-11-13 08:13:49 +10:00
style(changelog): add standard-version to automate releases and tags
This commit is contained in:
@ -2,8 +2,7 @@
|
|||||||
|
|
||||||
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
||||||
|
|
||||||
## [3.0.0](https://github.com/AmruthPillai/Reactive-Resume/compare/v3.0.0-beta.4...v3.0.0) (2022-03-10)
|
## [3.0.0-beta.5](https://github.com/AmruthPillai/Reactive-Resume/compare/v3.0.0-beta.4...v3.0.0-beta.5) (2022-03-10)
|
||||||
|
|
||||||
|
|
||||||
### Bug Fixes
|
### Bug Fixes
|
||||||
|
|
||||||
|
|||||||
@ -13,6 +13,7 @@ import {
|
|||||||
import { DateConfig, Resume } from '@reactive-resume/schema';
|
import { DateConfig, Resume } from '@reactive-resume/schema';
|
||||||
import dayjs from 'dayjs';
|
import dayjs from 'dayjs';
|
||||||
import get from 'lodash/get';
|
import get from 'lodash/get';
|
||||||
|
import { useRouter } from 'next/router';
|
||||||
import { useTranslation } from 'next-i18next';
|
import { useTranslation } from 'next-i18next';
|
||||||
import { useMemo } from 'react';
|
import { useMemo } from 'react';
|
||||||
import { useMutation } from 'react-query';
|
import { useMutation } from 'react-query';
|
||||||
@ -29,6 +30,8 @@ import { setResumeState } from '@/store/resume/resumeSlice';
|
|||||||
import { dateFormatOptions } from '@/utils/date';
|
import { dateFormatOptions } from '@/utils/date';
|
||||||
|
|
||||||
const Settings = () => {
|
const Settings = () => {
|
||||||
|
const router = useRouter();
|
||||||
|
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
|
||||||
const dispatch = useAppDispatch();
|
const dispatch = useAppDispatch();
|
||||||
@ -59,7 +62,14 @@ const Settings = () => {
|
|||||||
dispatch(setResumeState({ path: 'metadata.date.format', value }));
|
dispatch(setResumeState({ path: 'metadata.date.format', value }));
|
||||||
|
|
||||||
const handleChangeLanguage = (value: Language | null) => {
|
const handleChangeLanguage = (value: Language | null) => {
|
||||||
dispatch(setLanguage({ language: value?.code || 'en' }));
|
const { pathname, asPath, query } = router;
|
||||||
|
const locale = value?.code || 'en';
|
||||||
|
|
||||||
|
dayjs.locale(locale);
|
||||||
|
dispatch(setLanguage({ language: locale || 'en' }));
|
||||||
|
document.cookie = `NEXT_LOCALE=${locale}; path=/; expires=2147483647`;
|
||||||
|
|
||||||
|
router.push({ pathname, query }, asPath, { locale });
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleLoadSampleData = async () => {
|
const handleLoadSampleData = async () => {
|
||||||
|
|||||||
@ -9,6 +9,11 @@ export const languages: Language[] = [
|
|||||||
code: 'en',
|
code: 'en',
|
||||||
name: 'English',
|
name: 'English',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
code: 'kn',
|
||||||
|
name: 'Kannada',
|
||||||
|
localName: 'ಕನ್ನಡ',
|
||||||
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
export const languageMap: Record<string, Language> = languages.reduce(
|
export const languageMap: Record<string, Language> = languages.reduce(
|
||||||
|
|||||||
@ -3,7 +3,7 @@ const path = require('path');
|
|||||||
const i18nConfig = {
|
const i18nConfig = {
|
||||||
i18n: {
|
i18n: {
|
||||||
defaultLocale: 'en',
|
defaultLocale: 'en',
|
||||||
locales: ['en', 'ta'],
|
locales: ['en', 'kn'],
|
||||||
},
|
},
|
||||||
nsSeparator: '.',
|
nsSeparator: '.',
|
||||||
localePath: path.resolve('./public/locales'),
|
localePath: path.resolve('./public/locales'),
|
||||||
|
|||||||
@ -5,6 +5,9 @@ import { useEffect } from 'react';
|
|||||||
const DateWrapper: React.FC = ({ children }) => {
|
const DateWrapper: React.FC = ({ children }) => {
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
dayjs.extend(relativeTime);
|
dayjs.extend(relativeTime);
|
||||||
|
|
||||||
|
// Locales
|
||||||
|
require('dayjs/locale/kn');
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
return <>{children}</>;
|
return <>{children}</>;
|
||||||
|
|||||||
@ -1,27 +0,0 @@
|
|||||||
import { useRouter } from 'next/router';
|
|
||||||
import { useEffect } from 'react';
|
|
||||||
|
|
||||||
import { useAppSelector } from '@/store/hooks';
|
|
||||||
|
|
||||||
const LocaleWrapper: React.FC = ({ children }) => {
|
|
||||||
const router = useRouter();
|
|
||||||
|
|
||||||
const language = useAppSelector((state) => state.build.language);
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
if (!language) return;
|
|
||||||
|
|
||||||
const { code } = language;
|
|
||||||
const { pathname, asPath, query, locale } = router;
|
|
||||||
|
|
||||||
document.cookie = `NEXT_LOCALE=${code}; path=/; expires=2147483647`;
|
|
||||||
|
|
||||||
if (locale !== code) {
|
|
||||||
router.push({ pathname, query }, asPath, { locale: code });
|
|
||||||
}
|
|
||||||
}, [router, language]);
|
|
||||||
|
|
||||||
return <>{children}</>;
|
|
||||||
};
|
|
||||||
|
|
||||||
export default LocaleWrapper;
|
|
||||||
@ -1,7 +1,6 @@
|
|||||||
import DateWrapper from './DateWrapper';
|
import DateWrapper from './DateWrapper';
|
||||||
import FontWrapper from './FontWrapper';
|
import FontWrapper from './FontWrapper';
|
||||||
import HotkeysWrapper from './HotkeysWrapper';
|
import HotkeysWrapper from './HotkeysWrapper';
|
||||||
import LocaleWrapper from './LocaleWrapper';
|
|
||||||
import ThemeWrapper from './ThemeWrapper';
|
import ThemeWrapper from './ThemeWrapper';
|
||||||
|
|
||||||
const WrapperRegistry: React.FC = ({ children }) => {
|
const WrapperRegistry: React.FC = ({ children }) => {
|
||||||
@ -10,9 +9,7 @@ const WrapperRegistry: React.FC = ({ children }) => {
|
|||||||
<FontWrapper>
|
<FontWrapper>
|
||||||
<HotkeysWrapper>
|
<HotkeysWrapper>
|
||||||
<DateWrapper>
|
<DateWrapper>
|
||||||
<LocaleWrapper>
|
<>{children}</>
|
||||||
<>{children}</>
|
|
||||||
</LocaleWrapper>
|
|
||||||
</DateWrapper>
|
</DateWrapper>
|
||||||
</HotkeysWrapper>
|
</HotkeysWrapper>
|
||||||
</FontWrapper>
|
</FontWrapper>
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "reactive-resume",
|
"name": "reactive-resume",
|
||||||
"version": "3.0.0",
|
"version": "3.0.0-beta.5",
|
||||||
"private": true,
|
"private": true,
|
||||||
"workspaces": [
|
"workspaces": [
|
||||||
"schema",
|
"schema",
|
||||||
|
|||||||
788
pnpm-lock.yaml
generated
788
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user