Page 1 of 1

[INFO REQ] Localize the name of a view preset

Posted: Fri Aug 12, 2022 8:08 am
by EarlyHost

How is the correct way to localize the name of a preset?
I try in locale-de.js

  , PresetManager: {
    weekAndDay: { 
      "weekAndDay" : "Wochen",

but scheduler shows only the key weekAndDay...


Re: [INFO REQ] Localize the name of a view preset

Posted: Fri Aug 12, 2022 2:52 pm
by marcio

Hello EarlyHost,

Perhaps you're looking for the name key?? Could you please share how are you setting up the use of the localization in your presets configuration??


Re: [INFO REQ] Localize the name of a view preset

Posted: Wed Sep 07, 2022 1:25 pm
by EarlyHost

Sorry for the delay, but i was out of office.
The code snippet show an entry in the localization.js wich is loaded by the locale manger.
So weekAndDay is the Id of an preset and i hoped that preset manager or scheduler localize the name-property of this preset according to the id. Localization guids so nothing about localize a name of a preset, only date and time formats.


Re: [INFO REQ] Localize the name of a view preset

Posted: Wed Sep 07, 2022 2:12 pm
by alex.l

Every viewPreset has a name property that may contain human readable text.
This property has not being localized, I've opened a ticket for that https://github.com/bryntum/support/issues/5195
As a workaround, you could manually go throw it in scheduler.presets store and apply localized name.
https://bryntum.com/docs/scheduler/api/Scheduler/view/Scheduler#property-presets
https://bryntum.com/docs/scheduler/api/Scheduler/preset/PresetStore
https://bryntum.com/docs/scheduler/api/Scheduler/preset/PresetStore#function-forEach

but scheduler shows only the key weekAndDay...

Please let us know where in the Scheduler you see this key?


Re: [INFO REQ] Localize the name of a view preset

Posted: Mon Nov 07, 2022 6:42 pm
by EarlyHost

I finally work it out.
In the localization file under the PresetManager object, with the preset as a key and a new config object with a name. That did the job.
Could u please update u docs for localize a preset? This simple way is unfortunatly not documented :(


Re: [INFO REQ] Localize the name of a view preset

Posted: Mon Nov 07, 2022 7:20 pm
by marcio

Hey EarlyHost,

Glad that it worked! Could you please share an example of how you set it up?? Then we can update the documentation properly


Re: [INFO REQ] Localize the name of a view preset

Posted: Tue Nov 08, 2022 9:18 am
by EarlyHost

Heres the snippet from our custom locale

  PresetManager: {
    minuteAndHour: {
      topDateFormat: 'ddd DD.MM, HH:mm'
      , name: "Minuten"
    },
    hourAndDay: {
      topDateFormat: 'ddd DD.MM'
      , name: "Stunden"
    },
    weekAndDay: {
      displayDateFormat: 'HH:mm'
      , name: "Wochen"
    }
    , day: { name: "Tag/Stunden" }
    , week: { name: "Woche/Stunden" }
    , dayAndWeek: { name: "Woche/Tage" }
    , dayWeekOfTheYear: { name: "Kalenderwoche/Tage" }
    , dayAndMonth: { name: "Monat" }
    , weekOfTheYear: { name: "Monat/Kalenderwoche" }
    , weekAndDay: { name: "Woche" }
    , weekAndMonth: { name: "Wochen" }
    , weekAndDayLetter: { name: "Wochen/Wochentag" }
    , weekDateAndMonth: { name: "Monate/Wochen" }
    , monthAndYear: { name: "Monate" }
    , year: { name: "Jahre" }
    , manyYears: { name: "mehrerer Jahre" }
  },

Re: [INFO REQ] Localize the name of a view preset

Posted: Wed Nov 09, 2022 7:33 am
by alex.l

Thank you, you're right, it works, but not on the fly. We will fix this moment and update docs accordingly in bounds of this ticket https://github.com/bryntum/support/issues/5195