From ad04657f81c87697759bfe5f681d85ccf1ebb6e6 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Thu, 2 Sep 2021 23:12:08 -0400 Subject: [PATCH] Add pt lang. --- src/shared/i18next.ts | 2 ++ src/shared/utils.ts | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/shared/i18next.ts b/src/shared/i18next.ts index 4ba815c..797d381 100644 --- a/src/shared/i18next.ts +++ b/src/shared/i18next.ts @@ -29,6 +29,7 @@ import { nb_NO } from "./translations/nb_NO"; import { nl } from "./translations/nl"; import { oc } from "./translations/oc"; import { pl } from "./translations/pl"; +import { pt } from "./translations/pt"; import { pt_BR } from "./translations/pt_BR"; import { ru } from "./translations/ru"; import { sk } from "./translations/sk"; @@ -87,6 +88,7 @@ const resources = { mnc, sk, vi, + pt, }; function format(value: any, format: any): any { diff --git a/src/shared/utils.ts b/src/shared/utils.ts index ac7ad84..86e513b 100644 --- a/src/shared/utils.ts +++ b/src/shared/utils.ts @@ -145,6 +145,7 @@ export const languages = [ { code: "mnc" }, { code: "sk" }, { code: "vi" }, + { code: "pt" }, ]; export const themes = [ @@ -446,7 +447,7 @@ export function getMomentLanguage(): string { lang = "fa"; } else if (lang.startsWith("pl")) { lang = "pl"; - } else if (lang.startsWith("pt")) { + } else if (lang.startsWith("pt_BR")) { lang = "pt-br"; } else if (lang.startsWith("ja")) { lang = "ja"; @@ -496,6 +497,8 @@ export function getMomentLanguage(): string { lang = "sk"; } else if (lang.startsWith("vi")) { lang = "vi"; + } else if (lang.startsWith("pt")) { + lang = "pt"; } else { lang = "en"; } -- 2.44.1