Hi,
I tried to localise the date range picker in `TheSearchBar.vue` but it had no effects. I was wondering if you could point out anything wrong with Vue.js 3.
Besides, is there any way to apply it globally like in `App.vue`?
Regards,
Arvin
|
loadCldr(
require('cldr-data/main/zh/numbers.json'),
require('cldr-data/main/zh/ca-gregorian.json'),
require('cldr-data/main/zh/timeZoneNames.json')
); |
|
L10n.load({
"zh": {
daterangepicker: {
applyText: "确认",
},
},
});
setCulture("zh"); |
Hi,
Thanks for your reply! However, I'm afraid that it still does not solve my problem according to the results from my end. I have applied all changes mentioned above for my Vue 3 Electron app.
Btw, can this way apply in the app script rather than in the script of a component to make it being applied globally?
Best regards,
Arvin
Hi,
I still cannot make it work after modifying my app following the sample. In this way, I guess that the primary reason may be because the app is not a pure Vue.js 3 app but an Electron app using Vue.js 3. Maybe?
Btw, if I comment out `setCulture` in the component vue file and use the `locale` property of the DateRangePicker, it cannot show the dropdown part when I click the icon and prompt the following output in the browser console. I guess this may also be a reason?
Uncaught TypeError: Cannot convert undefined or null to object (calendar.js:313)
at Function.keys (<anonymous>)
at Proxy.push../node_modules/@syncfusion/ej2-vue-calendars/node_modules/@syncfusion/ej2-calendars/src/calendar/calendar.js.CalendarBase.getCultureValues (chunk-vendors.js:110063)
at Proxy.push../node_modules/@syncfusion/ej2-vue-calendars/node_modules/@syncfusion/ej2-calendars/src/calendar/calendar.js.CalendarBase.createContentHeader (chunk-vendors.js:110099)
at Proxy.push../node_modules/@syncfusion/ej2-vue-calendars/node_modules/@syncfusion/ej2-calendars/src/calendar/calendar.js.CalendarBase.createContent (chunk-vendors.js:110047)
at Proxy.push../node_modules/@syncfusion/ej2-vue-calendars/node_modules/@syncfusion/ej2-calendars/src/daterangepicker/daterangepicker.js.DateRangePicker.renderCalendar (chunk-vendors.js:117118)
at Proxy.push../node_modules/@syncfusion/ej2-vue-calendars/node_modules/@syncfusion/ej2-calendars/src/daterangepicker/daterangepicker.js.DateRangePicker.createCalendar (chunk-vendors.js:117235)
at Proxy.push../node_modules/@syncfusion/ej2-vue-calendars/node_modules/@syncfusion/ej2-calendars/src/daterangepicker/daterangepicker.js.DateRangePicker.createControl (chunk-vendors.js:117440)
at Proxy.push../node_modules/@syncfusion/ej2-vue-calendars/node_modules/@syncfusion/ej2-calendars/src/daterangepicker/daterangepicker.js.DateRangePicker.renderControl (chunk-vendors.js:115627)
at Proxy.push../node_modules/@syncfusion/ej2-vue-calendars/node_modules/@syncfusion/ej2-calendars/src/daterangepicker/daterangepicker.js.DateRangePicker.createPopup (chunk-vendors.js:115623)
at Proxy.push../node_modules/@syncfusion/ej2-vue-calendars/node_modules/@syncfusion/ej2-calendars/src/daterangepicker/daterangepicker.js.DateRangePicker.show (chunk-vendors.js:118649)
Kind regards,
Arvin
Hi Berly,
After further investigation, I can confirm AutoComplete can work as expected but DateRangePicker cannot. AutoComplete can be localised without `loadCldr`. The primary reason that DateRangePicker won't work is that I integrate Electron. It seems that `loadCldr` cannot work properly for Electron + Vue.js 3 because everything becomes what is expected when I uninstall packages relevant to Electron.
Regards,
Arvin
Attachment: Kobe_e8dda2bb.zip
Hi Berly,
Thanks so much for your reply!
- Procedures to run the sample
As for the sample, you could navigate to the debug section of VS Code and launch in the predefined mode called "electron: debug" or "electron: dev" on Windows/macOS after installing all dependencies. As an alternative, you could also use the command `npm run electron:serve` under the root directory. Please note that the app is a demo for evaluating the feasibility of developing a Windows/macOS desktop app using Vue 3 and Electron. Hence, the app is not expected to be launched and work well via the browser. Instead, a desktop app should be error-free and launched with the dev mode which means you could invoke the browser developer tools using the keys Ctrl+Shift/option+I.
- Discussion
I understand the necessity of loading CLDR. My assumption is that the function loadCldr() cannot work well when the app is implemented using Vue 3 and Electron together (but it could work well when using purely Vue 3). The reasons leading to this assumption is that global localisation can work well when I uninstall all dependencies related to Electron and make some necessary changes to vue-router.
I would really appreciate it if you could provide further suggestions regarding this issue using Vue 3 and Electron with your amazing components.
Best regards,
Arvin
Attachment: Kobe_9d82124c.zip