From 3a524f9c9c7a0e446491265b2242ad3dfeae188c Mon Sep 17 00:00:00 2001 From: Amruth Pillai Date: Fri, 11 Mar 2022 20:21:35 +0100 Subject: [PATCH] fix(lang): add hi, de to next-i18next --- README.md | 1 + client/config/languages.ts | 17 +++++++++++------ client/next-i18next.config.js | 2 +- client/wrappers/DateWrapper.tsx | 1 + docs/package.json | 2 +- 5 files changed, 15 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 95f957c5..b562cb2b 100644 --- a/README.md +++ b/README.md @@ -37,6 +37,7 @@ You have complete control over what goes into your resume, how it looks, what co - English - German (Deutsch) +- Hindi (हिन्दी) - Kannada (ಕನ್ನಡ) (@aksh1251) - Tamil (தமிழ்) diff --git a/client/config/languages.ts b/client/config/languages.ts index 07c1d18b..7ec67157 100644 --- a/client/config/languages.ts +++ b/client/config/languages.ts @@ -9,6 +9,16 @@ export const languages: Language[] = [ code: 'en', name: 'English', }, + { + code: 'de', + name: 'German', + localName: 'Deutsch', + }, + { + code: 'hi', + name: 'Hindi', + localName: 'हिन्दी', + }, { code: 'kn', name: 'Kannada', @@ -19,12 +29,7 @@ export const languages: Language[] = [ name: 'Tamil', localName: 'தமிழ்', }, - { - code: 'de', - name: 'German', - localName: 'Deutsch', - }, -]; +].sort((a, b) => a.name.localeCompare(b.name)); export const languageMap: Record = languages.reduce( (acc, lang) => ({ diff --git a/client/next-i18next.config.js b/client/next-i18next.config.js index 277ad723..47330cbd 100644 --- a/client/next-i18next.config.js +++ b/client/next-i18next.config.js @@ -3,7 +3,7 @@ const path = require('path'); const i18nConfig = { i18n: { defaultLocale: 'en', - locales: ['en', 'kn'], + locales: ['de', 'en', 'kn', 'ta', 'hi'], }, nsSeparator: '.', localePath: path.resolve('./public/locales'), diff --git a/client/wrappers/DateWrapper.tsx b/client/wrappers/DateWrapper.tsx index 234e9280..23806912 100644 --- a/client/wrappers/DateWrapper.tsx +++ b/client/wrappers/DateWrapper.tsx @@ -11,6 +11,7 @@ const DateWrapper: React.FC = ({ children }) => { // Locales require('dayjs/locale/de'); + require('dayjs/locale/hi'); require('dayjs/locale/kn'); require('dayjs/locale/ta'); diff --git a/docs/package.json b/docs/package.json index bc0300d5..eab8904a 100644 --- a/docs/package.json +++ b/docs/package.json @@ -2,7 +2,7 @@ "name": "@reactive-resume/docs", "scripts": { "docusaurus": "docusaurus", - "start": "docusaurus start --port 3200", + "start": "docusaurus start --port 3200 --no-open", "build": "docusaurus build", "swizzle": "docusaurus swizzle", "deploy": "docusaurus deploy",