Skip to content
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

Create ar-JO file for Arabic support #2477

Closed
wants to merge 1 commit into from
Closed
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
96 changes: 96 additions & 0 deletions packages/component/src/Localization/ar-JO.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
/* eslint no-magic-numbers: ["error", { "ignore": [1, 5, 24, 48, 60000, 3600000] }] */

import getLocaleString from './getLocaleString';

function xMinutesAgo(dateStr) {
const date = new Date(dateStr);
const dateTime = date.getTime();

if (isNaN(dateTime)) {
return dateStr;
}

const now = Date.now();
const deltaInMs = now - dateTime;
const deltaInMinutes = Math.floor(deltaInMs / 60000);
const deltaInHours = Math.floor(deltaInMs / 3600000);

if (deltaInMinutes < 1) {
return 'الآن';
} else if (deltaInMinutes === 1) {
return 'قبل دقيقة';
} else if (deltaInHours < 1) {
return `قبل ${deltaInMinutes} دقائق`;
} else if (deltaInHours === 1) {
return `An hour ago`;
} else if (deltaInHours < 5) {
return `قبل ${deltaInHours} ساعات`;
} else if (deltaInHours <= 24) {
return `اليوم`;
} else if (deltaInHours <= 48) {
return `الأمس`;
}
return getLocaleString(date, 'ar-JO');
}

function botSaidSomething(avatarInitials, text) {
return `رد الآلي ${avatarInitials} قال, ${text}`;
}

function downloadFileWithFileSize(downloadFileText, fileName, size) {
// Full text should read: "Download file <filename> of size <filesize>"
return `${downloadFileText} ${fileName} بحجم ${size}`;
}

function uploadFileWithFileSize(fileName, size) {
return `${fileName} بحجم ${size}`;
}

function userSaidSomething(avatarInitials, text) {
return `المستخدم ${avatarInitials} قال, ${text}`;
}

export default {
CONNECTED_NOTIFICATION: 'تم الإتصال',
FAILED_CONNECTION_NOTIFICATION: 'غير قادر عالإتصال.',
INITIAL_CONNECTION_NOTIFICATION: 'يتم الاتصال...',
INTERRUPTED_CONNECTION_NOTIFICATION: 'حدث انقطاع في الشبكة. إعادة الاتصال…',
RENDER_ERROR_NOTIFICATION: 'خطأ تقديم. يرجى التحقق من وحدة التحكم أو الاتصال مطور الروبوت.',
// Do not localize {Retry}; it is a placeholder for "Retry". English translation should be, "Send failed. Retry."
SEND_FAILED_KEY: `فشل في الارسال. {إعادة المحوالة}.`,
SLOW_CONNECTION_NOTIFICATION: 'الإتصال يستغرق اكثر من المعتاد.',
'الروبوت قال شيء': botSaidSomething,
'المستخدم قال شيء': userSaidSomething,
'قبل X دقائق': xMinutesAgo,
// '[File of type '%1']': '[File of type '%1']",
// '[Unknown Card '%1']': '[Unknown Card '%1']',
'Adaptive Card parse error': 'غير قادر على تفصيل بطاقة التكيف',
'Adaptive Card render error': 'غير قادر على عرض بطاقة التكيف',
BotSent: 'الرد الآلي أرسل: ',
Chat: 'دردش',
'Download file': 'تحميل الملف',
DownloadFileWithFileSize: downloadFileWithFileSize,
ErrorMessage: 'رسالة المشكلة',
'Microphone off': 'المايكروفون مغلق',
'Microphone on': 'المايكروفون يعمل',
Left: 'يسار',
'Listening…': 'جاري الإستماع…',
'New messages': 'رسائل جديدة',
Retry: 'إعادة المحاولة',
Right: 'يمين',
Send: 'إرسال',
SendBox: 'صندوق الإرسال',
Sending: 'جاري الإرسال',
SendStatus: 'حالة الإرسال: ',
SentAt: 'أرسل ب: ',
Speak: 'تكلم',
'Starting…': 'جاري البدء…',
Tax: 'ضريبة',
Total: 'المجموع',
'Type your message': 'اكتب رسالتك',
TypingIndicator: 'يتم عرض مؤشر الكتابة',
'Upload file': 'رفع الملف',
UploadFileWithFileSize: uploadFileWithFileSize,
UserSent: 'المستخدم أرسل: ',
VAT: 'VAT'
};