From 8578afcf48685b02401bfe6341ee29e2d1bc8e97 Mon Sep 17 00:00:00 2001 From: Benji Grant Date: Sun, 11 Jun 2023 00:27:06 +1000 Subject: [PATCH 1/4] Use yarn cache in frontend deployment --- .github/workflows/deploy_frontend.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/deploy_frontend.yml b/.github/workflows/deploy_frontend.yml index f14ff2b..f27e62f 100644 --- a/.github/workflows/deploy_frontend.yml +++ b/.github/workflows/deploy_frontend.yml @@ -23,6 +23,11 @@ jobs: steps: - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 18 + cache: yarn + cache-dependency-path: '**/yarn.lock' - name: Install Vercel CLI run: npm install --global vercel@latest - name: Pull Vercel Environment Information From 41ae58671c5725267c3b8ab925563538ddbd7ae7 Mon Sep 17 00:00:00 2001 From: Benji Grant Date: Sun, 11 Jun 2023 00:33:32 +1000 Subject: [PATCH 2/4] Ignore locale files when checking frontend --- .github/workflows/check_frontend.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/check_frontend.yml b/.github/workflows/check_frontend.yml index 02c5938..16920ce 100644 --- a/.github/workflows/check_frontend.yml +++ b/.github/workflows/check_frontend.yml @@ -5,6 +5,8 @@ on: paths: - frontend/** - .github/workflows/check_frontend.yml + paths-ignore: + - frontend/src/i18n/locales/** jobs: lint: From 5df088752d30dad7c1b9f535f4349c6000a96d37 Mon Sep 17 00:00:00 2001 From: Benji Grant Date: Sun, 11 Jun 2023 00:55:37 +1000 Subject: [PATCH 3/4] Add support for Italian and Portuguese (from Portugal) --- frontend/src/i18n/options.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/frontend/src/i18n/options.ts b/frontend/src/i18n/options.ts index b66dabf..8ffc3bf 100644 --- a/frontend/src/i18n/options.ts +++ b/frontend/src/i18n/options.ts @@ -5,7 +5,7 @@ export const defaultNS = 'common' export const cookieName = 'i18next' export const languages = [ fallbackLng, - 'en-GB', 'de', 'es', 'fr', 'hi', 'id', 'ja', 'ko', 'pl', 'pt-BR', 'ru', + 'en-GB', 'de', 'es', 'fr', 'hi', 'id', 'it', 'ja', 'ko', 'pl', 'pt', 'pt-BR', 'ru', ] as const export const getOptions = (lng = fallbackLng, ns: InitOptions['ns'] = defaultNS): InitOptions => ({ @@ -65,6 +65,11 @@ export const languageDetails: Record weekStart: 1, timeFormat: '24h', }, + 'it': { // Italian + name: 'Italiano', + weekStart: 1, + timeFormat: '24h', + }, 'ja': { // Japanese name: '日本語', weekStart: 0, @@ -80,6 +85,11 @@ export const languageDetails: Record weekStart: 1, timeFormat: '12h', }, + 'pt': { // Portuguese (Portugal) + name: 'Português (do Portugal)', + weekStart: 0, + timeFormat: '24h', + }, 'pt-BR': { // Portuguese (Brazil) name: 'Português (do Brasil)', weekStart: 0, From 3e290b77e1a310ca1b02a14a1d8c08f5571c79be Mon Sep 17 00:00:00 2001 From: Benji Grant Date: Sun, 11 Jun 2023 01:04:31 +1000 Subject: [PATCH 4/4] Use correct language code for Portuguese --- frontend/src/i18n/locales/{pt_PT => pt-PT}/common.json | 0 frontend/src/i18n/locales/{pt_PT => pt-PT}/event.json | 0 frontend/src/i18n/locales/{pt_PT => pt-PT}/help.json | 0 frontend/src/i18n/locales/{pt_PT => pt-PT}/home.json | 0 frontend/src/i18n/locales/{pt_PT => pt-PT}/privacy.json | 0 frontend/src/i18n/options.ts | 4 ++-- 6 files changed, 2 insertions(+), 2 deletions(-) rename frontend/src/i18n/locales/{pt_PT => pt-PT}/common.json (100%) rename frontend/src/i18n/locales/{pt_PT => pt-PT}/event.json (100%) rename frontend/src/i18n/locales/{pt_PT => pt-PT}/help.json (100%) rename frontend/src/i18n/locales/{pt_PT => pt-PT}/home.json (100%) rename frontend/src/i18n/locales/{pt_PT => pt-PT}/privacy.json (100%) diff --git a/frontend/src/i18n/locales/pt_PT/common.json b/frontend/src/i18n/locales/pt-PT/common.json similarity index 100% rename from frontend/src/i18n/locales/pt_PT/common.json rename to frontend/src/i18n/locales/pt-PT/common.json diff --git a/frontend/src/i18n/locales/pt_PT/event.json b/frontend/src/i18n/locales/pt-PT/event.json similarity index 100% rename from frontend/src/i18n/locales/pt_PT/event.json rename to frontend/src/i18n/locales/pt-PT/event.json diff --git a/frontend/src/i18n/locales/pt_PT/help.json b/frontend/src/i18n/locales/pt-PT/help.json similarity index 100% rename from frontend/src/i18n/locales/pt_PT/help.json rename to frontend/src/i18n/locales/pt-PT/help.json diff --git a/frontend/src/i18n/locales/pt_PT/home.json b/frontend/src/i18n/locales/pt-PT/home.json similarity index 100% rename from frontend/src/i18n/locales/pt_PT/home.json rename to frontend/src/i18n/locales/pt-PT/home.json diff --git a/frontend/src/i18n/locales/pt_PT/privacy.json b/frontend/src/i18n/locales/pt-PT/privacy.json similarity index 100% rename from frontend/src/i18n/locales/pt_PT/privacy.json rename to frontend/src/i18n/locales/pt-PT/privacy.json diff --git a/frontend/src/i18n/options.ts b/frontend/src/i18n/options.ts index 8ffc3bf..6db015c 100644 --- a/frontend/src/i18n/options.ts +++ b/frontend/src/i18n/options.ts @@ -5,7 +5,7 @@ export const defaultNS = 'common' export const cookieName = 'i18next' export const languages = [ fallbackLng, - 'en-GB', 'de', 'es', 'fr', 'hi', 'id', 'it', 'ja', 'ko', 'pl', 'pt', 'pt-BR', 'ru', + 'en-GB', 'de', 'es', 'fr', 'hi', 'id', 'it', 'ja', 'ko', 'pl', 'pt-PT', 'pt-BR', 'ru', ] as const export const getOptions = (lng = fallbackLng, ns: InitOptions['ns'] = defaultNS): InitOptions => ({ @@ -85,7 +85,7 @@ export const languageDetails: Record weekStart: 1, timeFormat: '12h', }, - 'pt': { // Portuguese (Portugal) + 'pt-PT': { // Portuguese (Portugal) name: 'Português (do Portugal)', weekStart: 0, timeFormat: '24h',