Language localization

You have the possibility to adapt the scheduler for a specific country or region by setting the related language of the interface.

Activation

To activate the necessary locale, you need to use the Set() method of the DHXScheduler.Localization class:

sched.Localization.Set(SchedulerLocalization.Localizations.German);

By default, the locales are found in the directory scripts/dhtmlxScheduler.

As soon as you call the Set() method, 2 new script tags are added to your page automatically:

  • locale_[lang_name].js (classic events)
  • locale_recurring_[lang_name].js (recurring events)


Note, if you aren't going to use recurring events in the scheduler, you can pass the second parameter false to the Set() method. In this case, just the locale_[lang_name].js script tag will be added to the page.

sched.Localization.Set(SchedulerLocalization.Localizations.German, false);

Included locales

All the locales can be accessed through enumeration SchedulerLocalization.Localizations and they are:

  • Arabic
  • Catalan
  • Chinese
  • Czech
  • Danish
  • Dutch
  • English(default)
  • Finnish
  • Belarusian
  • French
  • German
  • Greek
  • Hebrew
  • Hungarian
  • Indonesia
  • Italian
  • Japanese
  • Romanian
  • Norwegian
  • Polish
  • Portuguese
  • Russian
  • Slovenian
  • Spanish
  • Swedish
  • Turkish
  • Ukrainian

Custom locale

In case the enum doesn't contain the locale needing for you, you can create a new one.
Note, a locale file must be written in Javascript. For detail description of such creating, refer to the related dhtmlxScheduler documentation.

To apply a newly-created locale to your scheduler, just specify in the Set() method the short name of this locale:

sched.Localization.Set('lang_name');

Note, if you aren't going to use recurring events in the scheduler, you can pass the second parameter false to the Set() method.

For example, if you created a new locale for the Lithuanian language, to apply it you should call:

sched.Localization.Set('lt');

Automatically, locale_lt.js and locale_recurring_lt.js will be added.

Properties

Class DHXScheduler.Localization has the only property:

  • Directory - sets the path to locale files relative to default directory scripts/dhtmlxScheduler.

comments powered by Disqus