Skip to content

Commit

Permalink
feat(locales): Created fa_IR locale to add support of Persian languag…
Browse files Browse the repository at this point in the history
…e in Rsuite locals (#2061)

* Created fa_IR locale to add support of persian language in rsuite locals

* ort mistake & add fa_IR to locale tests page in docs
  • Loading branch information
Sina Farhadi committed Oct 28, 2021
1 parent a8baa61 commit 14e5946
Show file tree
Hide file tree
Showing 5 changed files with 83 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/pages/guide/i18n/en-US/index.md
Expand Up @@ -28,6 +28,7 @@ return (
| en_US | American English |
| es_AR | Spanish (Argentina) |
| es_ES | Spanish (Spain) |
| fa_IR | Persian (Iran) |
| fi_FI | Finnish |
| it_IT | Italian |
| ko_KR | Korean |
Expand Down
2 changes: 2 additions & 0 deletions docs/pages/guide/i18n/index.tsx
Expand Up @@ -17,6 +17,7 @@ import ru_RU from 'rsuite/locales/ru_RU';
import sv_SE from 'rsuite/locales/sv_SE';
import zh_CN from 'rsuite/locales/zh_CN';
import zh_TW from 'rsuite/locales/zh_TW';
import fa_IR from 'rsuite/locales/fa_IR';

const locales = [
{ key: 'ar_EG', value: ar_EG },
Expand All @@ -26,6 +27,7 @@ const locales = [
{ key: 'en_US', value: en_US },
{ key: 'es_AR', value: es_AR },
{ key: 'es_ES', value: es_ES },
{ key: 'fa_IR', value: fa_IR },
{ key: 'fi_FI', value: fi_FI },
{ key: 'it_IT', value: it_IT },
{ key: 'ko_KR', value: ko_KR },
Expand Down
1 change: 1 addition & 0 deletions docs/pages/guide/i18n/zh-CN/index.md
Expand Up @@ -28,6 +28,7 @@ return (
| en_US | 美式英语 |
| es_AR | 西班牙语 (阿根廷) |
| es_ES | 西班牙语 (西班牙) |
| fa_IR | 波斯语 (伊朗) |
| fi_FI | 芬兰语 |
| it_IT | 意大利语 |
| ko_KR | 韩语/朝鲜语 |
Expand Down
78 changes: 78 additions & 0 deletions src/locales/fa_IR.ts
@@ -0,0 +1,78 @@
import faIR from 'date-fns/locale/fa-IR';

const Calendar = {
sunday: 'یکشنبه',
monday: 'دوشنبه',
tuesday: 'سه شنبه',
wednesday: 'چهارشنبه',
thursday: 'پنجشنبه',
friday: 'جمعه',
saturday: 'شنبه',
ok: 'خوب',
today: 'امروز',
yesterday: 'دیروز',
hours: 'ساعت',
minutes: 'دقیقه',
seconds: 'ثانیه',
formattedMonthPattern: 'MMM, yyyy',
formattedDayPattern: 'MMM dd, yyyy',
dateLocale: faIR as any
};

export default {
common: {
loading: 'در حال بارگذاری...',
emptyMessage: 'داده ایی پیدا نشد'
},
Plaintext: {
unfilled: 'خالی',
notSelected: 'انتخاب نشده',
notUploaded: 'اپلود نشده'
},
Pagination: {
more: 'بیشتر',
prev: 'قبلی',
next: 'بعدی',
first: 'اول',
last: 'اخر',
limit: '{0} / صفحه',
total: 'مجموع ردیف ها: {0}',
skip: 'برو به{0}'
},
Calendar,
DatePicker: {
...Calendar
},
DateRangePicker: {
...Calendar,
last7Days: '7 روز اخر'
},
Picker: {
noResultsText: 'نتیجه ایی یافت نشد',
placeholder: 'انتخاب',
searchPlaceholder: 'جستجو',
checkAll: 'همه'
},
InputPicker: {
newItem: 'گزینه جدید',
createOption: 'ساخت گزینه "{0}"'
},
Uploader: {
inited: 'اولیه',
progress: 'در حال اپلود',
error: 'مشکل',
complete: 'تمام شد',
emptyFile: 'خالی',
upload: 'اپلود'
},
CloseButton: {
closeLabel: 'بستن'
},
Breadcrumb: {
expandText: 'نمایش مسیر'
},
Toggle: {
on: 'باز کردن',
off: 'بستن'
}
};
1 change: 1 addition & 0 deletions src/locales/index.ts
Expand Up @@ -14,6 +14,7 @@ export { default as ruRU } from './ru_RU';
export { default as svSE } from './sv_SE';
export { default as zhCN } from './zh_CN';
export { default as zhTw } from './zh_TW';
export { default as faIR } from './fa_IR';

type PickKeys<T> = {
[keys in keyof T]?: T[keys];
Expand Down

0 comments on commit 14e5946

Please sign in to comment.