import { fData } from '../utils/formatNumber'; import { LocaleText } from './types'; export const DEFAULT_LANG = 'en'; export const DEFAULT_LOCASES_TEXTS: Record> = { fa: { 'validation.required': () => 'این فیلد اجباری می‌باشد', 'validation.pattern': ({ label }) => `${label} وارد شده معتبر نمی‌باشد`, 'validation.minLength': ({ minLength }) => `حداقل تعداد کاراکتر مجاز ${minLength} کاراکتر می‌باشد`, 'validation.maxLength': ({ maxLength }) => `حداکثر تعداد کاراکتر مجاز ${maxLength} کاراکتر می‌باشد`, 'validation.min': ({ min }) => `حداقل عدد مجاز ${min} می‌باشد`, 'validation.max': ({ max }) => `حداکثر عدد مجاز ${max} می‌باشد`, 'autocomplete.noOptionsText': 'داده ای موجود نیست', 'autocomplete.loadingText': 'در حال بارگذاری...', 'autocomplete.openText': 'باز', 'autocomplete.closeText': 'بسته', 'datePicker.timePickerToolbarTitle': 'انتخاب زمان', 'datePicker.dateTimePickerToolbarTitle': 'انتخاب تاریخ و زمان', 'datePicker.datePickerToolbarTitle': 'انتخاب تاریخ', 'datePicker.toolbarTitle': 'انتخاب تاریخ', 'datePicker.cancelButtonLabel': 'لغو', 'datePicker.clearButtonLabel': 'پاک کردن', 'datePicker.okButtonLabel': 'تأیید', 'datePicker.todayButtonLabel': 'امروز', 'datePicker.dateTableLabel': 'انتخاب تاریخ', 'datePicker.previousMonth': 'ماه قبل', 'datePicker.nextMonth': 'ماه بعد', 'datePicker.startDate': 'تاریخ شروع', 'datePicker.endDate': 'تاریخ پایان', 'datePicker.fieldClearLabel': 'پاک کردن', 'datePicker.fieldDayPlaceholder': () => { return 'روز'; }, 'datePicker.fieldMonthPlaceholder': () => { return 'ماه'; }, 'datePicker.fieldYearPlaceholder': () => { return 'سال'; }, 'datePicker.fieldHoursPlaceholder': () => { return 'ساعت'; }, 'datePicker.fieldMinutesPlaceholder': () => { return 'دقیقه'; }, 'datePicker.fieldSecondsPlaceholder': () => { return 'ثانیه'; }, 'upload.validation.fileInvalidType': ({ accept }) => { let types = ''; Object.entries(accept).forEach(([MIMEType, extentions]) => { types = types.concat(types.length ? ` , ${MIMEType}` : MIMEType); if (extentions?.length) { types = types.concat(` ( ${extentions.join(' , ')} )`); } }); return `نوع فایل باید یکی از این انواع باشد: ${types}.`; }, 'upload.validation.fileTooLarge': ({ maxSize }) => { return `اندازه فایل باید کوچک‌تر از ${fData(maxSize)} باشد.`; }, 'upload.validation.fileTooSmall': ({ minSize }) => { return `اندازه فایل باید بزرگ‌تر از ${fData(minSize)} باشد.`; }, 'upload.validation.tooManyFiles': ({ maxFiles }) => { return `حداکثر تعداد فایل انتخابی ${maxFiles} فایل می‌باشد.`; }, 'upload.placeholder.dropOrSelectFile': 'فایل را اینجا رها کنید یا انتخاب کنید', 'upload.placeholder.DropFilesHereOrClickTo': 'فایل را بکشید و اینجا رها کنید یا', 'upload.placeholder.browse': 'برای انتخاب فایل', 'upload.placeholder.throughYourMachine': 'کلیک کنید.', 'upload.removeAll': 'حذف همه', 'upload.remove': 'حذف', 'upload.upload': 'بارگذاری', 'locationPicker.geolocationPositionError': () => 'امکان تعیین مکان دقیق شما وجود ندارد.', 'locationPicker.userLocationTooltipText': 'مکان شما', 'select.emptyOptionLabel': 'همه' }, en: { 'validation.required': () => `this field is required`, 'validation.pattern': ({ label }) => `${label} is not valid`, 'validation.minLength': ({ minLength }) => `The number of entered characters must be more than or equal to ${minLength}`, 'validation.maxLength': ({ maxLength }) => `The number of entered characters must be less than or equal to ${maxLength}`, 'validation.min': ({ min }) => `The entered number must be greater than or equal to ${min}`, 'validation.max': ({ max }) => `The entered number must be less than or equal to ${max}`, 'autocomplete.noOptionsText': 'No options', 'autocomplete.loadingText': 'Loading...', 'autocomplete.openText': 'Open', 'autocomplete.closeText': 'Close', 'datePicker.timePickerToolbarTitle': 'Select Time', 'datePicker.dateTimePickerToolbarTitle': 'Select Date and Time', 'datePicker.datePickerToolbarTitle': 'Select Date', 'datePicker.toolbarTitle': 'Select Date', 'datePicker.cancelButtonLabel': 'Cancel', 'datePicker.clearButtonLabel': 'Clear', 'datePicker.okButtonLabel': 'OK', 'datePicker.todayButtonLabel': 'Today', 'datePicker.dateTableLabel': 'Pick a Date', 'datePicker.previousMonth': 'Previous Month', 'datePicker.nextMonth': 'Next Month', 'datePicker.startDate': 'Start Date', 'datePicker.endDate': 'End Date', 'datePicker.fieldClearLabel': 'Clear', 'datePicker.fieldDayPlaceholder': () => { return 'Day'; }, 'datePicker.fieldMonthPlaceholder': () => { return 'Month'; }, 'datePicker.fieldYearPlaceholder': () => { return 'Year'; }, 'datePicker.fieldHoursPlaceholder': () => { return 'Hour'; }, 'datePicker.fieldMinutesPlaceholder': () => { return 'Minute'; }, 'datePicker.fieldSecondsPlaceholder': () => { return 'Second'; }, 'upload.validation.fileInvalidType': ({ accept }) => { let types = ''; Object.entries(accept).forEach(([MIMEType, extentions]) => { types = types.concat(types.length ? ` , ${MIMEType}` : MIMEType); if (extentions?.length) { types = types.concat(` ( ${extentions.join(' , ')} )`); } }); return `File type must be one of ${types}.`; }, 'upload.validation.fileTooLarge': ({ maxSize }) => { return `File is larger than ${fData(maxSize)}.`; }, 'upload.validation.fileTooSmall': ({ minSize }) => { return `File is smaller than ${fData(minSize)}.`; }, 'upload.validation.tooManyFiles': ({ maxFiles }) => { return `The maximum number of files is ${maxFiles} files.`; }, 'upload.placeholder.dropOrSelectFile': 'Drop or select file', 'upload.placeholder.DropFilesHereOrClickTo': 'Drop files here or click to', 'upload.placeholder.browse': 'browse', 'upload.placeholder.throughYourMachine': 'through your machine.', 'upload.removeAll': 'Remove all', 'upload.remove': 'Remove', 'upload.upload': 'Upload', 'locationPicker.geolocationPositionError': () => 'Your precise location could not be determined.', 'locationPicker.userLocationTooltipText': 'Show Your Location', 'select.emptyOptionLabel': 'All' } };