Premium support for our pure JavaScript UI components


Post 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...


Post 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??

Best regards,
Márcio


Post 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.


Post 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?

All the best,
Alex


Post 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 :(


Post 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

Best regards,
Márcio


Post 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" }
  },

Post 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

All the best,
Alex


Post Reply