Skip to content

📚 add arabic local for V3 #2104

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: v3
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion frontend/src/locale/IntlProvider.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { createIntl, createIntlCache } from "react-intl";

import langAR from "./lang/ar.json";
import langDe from "./lang/de.json";
import langEn from "./lang/en.json";
import langFa from "./lang/fa.json";
Expand All @@ -12,6 +12,7 @@ const localeOptions = [
["en", "en-US"],
["de", "de-DE"],
["fa", "fa-IR"],
["ar", "ar-SA"],
];

const loadMessages = (locale?: string): typeof langList & typeof langEn => {
Expand All @@ -21,6 +22,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);
}
Expand All @@ -34,6 +37,9 @@ const getFlagCodeForLocale = (locale?: string) => {
case "fa-IR":
case "fa":
return "IR";
case "ar-SA":
case "ar":
return "AR";
default:
return "US";
}
Expand Down
Loading