From 337b9c65aeded7637c5bf455fed46fe6f4969743 Mon Sep 17 00:00:00 2001 From: Abdulaziz Date: Thu, 9 Jun 2022 21:07:00 +0300 Subject: [PATCH] Update IntlProvider.tsx --- frontend/src/locale/IntlProvider.tsx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/frontend/src/locale/IntlProvider.tsx b/frontend/src/locale/IntlProvider.tsx index a239c3d5..562aa6c0 100644 --- a/frontend/src/locale/IntlProvider.tsx +++ b/frontend/src/locale/IntlProvider.tsx @@ -3,6 +3,7 @@ import { createIntl, createIntlCache } from "react-intl"; import langDe from "./lang/de.json"; import langEn from "./lang/en.json"; import langFa from "./lang/fa.json"; +import langAR from "./lang/ar.json"; import langList from "./lang/lang-list.json"; // first item of each array should be the language code, @@ -12,6 +13,7 @@ const localeOptions = [ ["en", "en-US"], ["de", "de-DE"], ["fa", "fa-IR"], + ["ar", "ar-SA"], ]; const loadMessages = (locale?: string): typeof langList & typeof langEn => { @@ -21,6 +23,8 @@ const loadMessages = (locale?: string): typeof langList & typeof langEn => { return Object.assign({}, langList, langEn, langDe); case "fa": return Object.assign({}, langList, langEn, langFa); + case "ar": + return Object.assign({}, langList, langEn, langAR); default: return Object.assign({}, langList, langEn); } @@ -34,6 +38,9 @@ const getFlagCodeForLocale = (locale?: string) => { case "fa-IR": case "fa": return "IR"; + case "ar-SA": + case "ar": + return "AR"; default: return "US"; }