From d2de8ddbae79ce8fae0c0913815ff2fe71286fa3 Mon Sep 17 00:00:00 2001 From: El Babilonio Date: Mon, 8 Jan 2024 15:19:18 +0300 Subject: [PATCH] Add Arabic language support --- src/translations/ar.json | 41 ++++++++++++++++++++++++++++++++++ src/translations/index.js | 3 ++- src/translations/index.test.js | 5 +++++ 3 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 src/translations/ar.json diff --git a/src/translations/ar.json b/src/translations/ar.json new file mode 100644 index 000000000..e1167db98 --- /dev/null +++ b/src/translations/ar.json @@ -0,0 +1,41 @@ +{ + "log_in": "سجل دخول", + "log_out": "سجل خروج", + "logged_in_as": "مسجل كـ", + "logged_in": "مسجل", + "logging_in": "في طور تسجيل الدخول", + "logging_out": "في طور تسجيل الخروج", + "sign_up": "اشترك", + "signing_up": "في طور الاشتراك", + "forgot_password": "نسيت كلمة السر؟", + "recover_password": "استعد كلمة المرور", + "send_recovery_email": "إرسل البريد الإلكتروني للاسترداد", + "sending_recovery_email": "في طور إرسال البريد الإلكتروني للاسترداد", + "never_mind": "العودة", + "update_password": "تحديث كلمة المرور", + "updating_password": "في طور تحديث كلمة المرور", + "complete_your_signup": "أكمل اشتراكك", + "site_url_title": "إعدادات التطوير", + "site_url_link_text": "امسح عنوان الرابط للمضيف المحلي", + "site_url_message": "يبدو أنك تقوم بتشغيل خادم محلي. يرجى إعلامنا بعنوان الرابط لموقع نتليفاي الخاص بك.", + "site_url_label": "أدخل عنوان الرابط لموقع نتليفاي الخاص بك", + "site_url_placeholder": "عنوان الرابط لموقع نتليفاي الخاص بك", + "site_url_submit": "عين عنوان الرابط للموقع", + "message_confirm": "تم إرسال رسالة تأكيد إلى بريدك الإلكتروني، انقر فوق الرابط هناك للمتابعة.", + "message_password_mail": "لقد أرسلنا بريدًا إلكترونيًا لاسترداد كلمة المرور إلى حسابك، اتبع الرابط الموجود هناك لإعادة تعيين كلمة المرور الخاصة بك.", + "message_email_changed": "لقد تم تحديث عنوان بريدك الإلكتروني!", + "message_verfication_error": "حدث خطأ في التحقق من حسابك. الرجاء المحاولة مرة أخرى أو الاتصال بالمسؤول.", + "message_signup_disabled": "الاشتراكات العامة معطلة. اتصل بالمسؤول واطلب دعوة.", + "form_name_placeholder": "الإسم", + "form_email_label": "أدخل بريدك الإلكتروني", + "form_name_label": "أدخل أسمك", + "form_email_placeholder": "البريد إلكتروني", + "form_password_label": "أدخل كلمة المرور الخاصة بك", + "form_password_placeholder": "كلمة المرور", + "coded_by": "مبرمج بواسطة نتليفاي", + "continue_with": "إستمر مع", + "No user found with this email": "لم يتم العثور على مستخدم لديه هذا البريد الإلكتروني", + "Invalid Password": "كلمة المرور غير صحيحة", + "Email not confirmed": "لم يتم تأكيد البريد الإلكتروني", + "User not found": "لم يتم العثور على المستخدم" +} diff --git a/src/translations/index.js b/src/translations/index.js index 1119f6f7f..9d1fd9528 100644 --- a/src/translations/index.js +++ b/src/translations/index.js @@ -6,9 +6,10 @@ import * as pt from "./pt.json"; import * as pl from "./pl.json"; import * as cs from "./cs.json"; import * as sk from "./sk.json"; +import * as ar from "./ar.json"; export const defaultLocale = "en"; -const translations = { en, fr, es, hu, pt, pl, cs, sk }; +const translations = { en, fr, es, hu, pt, pl, cs, sk, ar }; export const getTranslation = (key, locale = defaultLocale) => { const translated = translations[locale] && translations[locale][key]; diff --git a/src/translations/index.test.js b/src/translations/index.test.js index 55bb47496..4075132b2 100644 --- a/src/translations/index.test.js +++ b/src/translations/index.test.js @@ -48,6 +48,11 @@ describe("translations", () => { expect(getTranslation("log_in", "sk")).toEqual("Prihlásiť sa"); }); + it("should return translation for 'ar' locale", () => { + const { getTranslation } = require("./"); + expect(getTranslation("log_in", "ar")).toEqual("سجل دخول"); + }); + it("should return key for non existing translation", () => { const { getTranslation } = require("./"); expect(getTranslation("unknown_key")).toEqual("unknown_key");