savannabits / filament-flatpickr

Extend your Filament Date-Picking with Flatpickr
MIT License
43 stars 29 forks source link

[Question]: Multi language support #39

Open Gelidan opened 9 months ago

Gelidan commented 9 months ago

What happened?

I know this is not a bug, but there is no feature request option

How to reproduce the bug

Any ETA on multi language support? It would be much appreciated.

Package Version

2

PHP Version

8.2

Laravel Version

10

Which operating systems does with happen with?

No response

Notes

No response

shicosoft2011 commented 9 months ago
dgironella commented 7 months ago

Is there any forecast for a solution to have multilanguage support? The package does its job very well, but the language issue is very important for many projects.

kpsanmao commented 5 months ago

A temporary solution

  1. format public/js/coolsam/flatpickr/components/flatpickr-component.js code online js formater tool :https://tools.02405.com/tool/js-formatter

  2. change the code below to your language:

    weekdays: {
         shorthand: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
         longhand: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]
     },
     months: {
         shorthand: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
         longhand: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October",  "November", "December"]
     },
     rangeSeparator: " to ",
     weekAbbreviation: "Wk",
     scrollTitle: "Scroll to increment",
    toggleTitle: "Click to toggle",

example:

   weekdays: {
       shorthand: ["周日", "周一", "周二", "周三", "周四", "周五", "周六"],
       longhand: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"]
   },
   months: {
       shorthand: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
       longhand: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"]
   },
   rangeSeparator: " 至 ",
   weekAbbreviation: "周",
   scrollTitle: "滚动切换",
   toggleTitle: "点击切换 12/24 小时时制",

微信截图_20240109153058