web-ridge / react-native-paper-dates

Smooth and fast cross platform Material Design date and time picker for React Native Paper
https://www.reactnativepaperdates.com
MIT License
667 stars 172 forks source link

Could you add thai locale #128

Closed chukiatt closed 2 years ago

chukiatt commented 2 years ago

Dear Sir,

I found your library is number #1 of datetime picker in the world. But i need to developt app in THAI language. could you add a thai locale into your library.

save: 'บันทึก', selectSingle: 'เลือกวันที่', selectMultiple: 'เลือกวันที่', selectRange: 'เลือกช่วงวันที่', notAccordingToDateFormat: (inputFormat: string) => วันที่จะต้อง ${inputFormat}, mustBeHigherThan: 'ต้องมากกว่า', mustBeLowerThan: 'ต้องน้อยกว่า', mustBeBetween: 'ต้องอยู่ระหว่าง', dateIsDisabled: 'ไม่อนุญาติ',

MONTH_FULLNAME = { th: [ 'มกราคม', 'กุมภาพันธ์', 'มีนาคม', 'เมษายน', 'พฤษภาคม', 'มิถุนายน', 'กรกฏาคม', 'สิงหาคม', 'กันยายน', 'ตุลาคม', 'พฤศจิกายน', 'ธันวาคม', ], en: [ 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December', ], };

MONTH_SHORTNAME = { th: [ 'ม.ค.', 'ก.พ.', 'มี.ค.', 'เม.ย.', 'พ.ค.', 'มิ.ย.', 'ก.ค.', 'ส.ค.', 'ก.ย.', 'ต.ค.', 'พ.ย.', 'ธ.ค.', ], en: [ 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec', ], };

AND DATE FORMAT IS DD/MM/YYYY

I hope this library can be support thai language . Please help thailand people.

Thank you very much

RichardLindhout commented 2 years ago

I can add this, only the thing below is needed but mustBeHigherThan, mustBeLowerThan, mustBeBetween have been changed could you update your code? Also is the i18n key reallythai or th?

const en: TranslationsType = {
  save: 'Save',
  selectSingle: 'Select date',
  selectMultiple: 'Select dates',
  selectRange: 'Select period',
  notAccordingToDateFormat: (inputFormat) =>
    `Date format must be ${inputFormat}`,
  mustBeHigherThan: (date) => `Must be later then ${date}`,
  mustBeLowerThan: (date) => `Must be earlier then ${date}`,
  mustBeBetween: (startDate, endDate) =>
    `Must be between ${startDate} - ${endDate}`,
  dateIsDisabled: 'Day is not allowed',
  previous: 'Previous',
  next: 'Next',
  typeInDate: 'Type in date',
  pickDateFromCalendar: 'Pick date from calendar',
  close: 'Close',
}
RichardLindhout commented 2 years ago

Please add a PR for this!