Localization

The library supports scheduler's localization by providing a number of predefined locales and means of creating custom ones.

Activation

To set the desired language for the scheduler, include the related locale 'js' file on the page. For example, to present the scheduler in Spanish you need to have the following files included on the page:

<script src="../codebase/dhtmlxscheduler.js"></script>
<link rel="stylesheet" href="../codebase/dhtmlxscheduler.css">
 
<script src="../sources/locale/locale_es.js" charset="utf-8"></script>

Make sure that you use charset="utf-8", because all locales are stored as UTF-8 text.

Related sample:  Localization

Recurring events

If you are using recurring events, one more file needs including - the localized form for recurring events.

<script src="../codebase/dhtmlxscheduler.js" type="text/javascript"></script>
<link rel="stylesheet" href="../codebase/dhtmlxscheduler.css" type="text/css">
 
<script src="../sources/locale/locale_es.js" type="text/javascript"></script>
<script src="../sources/locale/recurring/locale_recurring_es.js" ></script>

Included locales

Note,

  • Common locale files reside in the scheduler/sources/locale/ folder.
  • Recurring locale files reside in the scheduler/sources/locale/recurring/ folder.

dhtmlxScheduler includes localization for the following languages:

Language Common locale Recurring events form
Arabic locale_ar.js not translated
Belarusian locale_be.js locale_recurring_be.js
Catalan locale_ca.js not translated
Chinese locale_cn.js locale_recurring_cn.js
Czech locale_cs.js locale_recurring_cs.js
Danish locale_da.js locale_recurring_da.js
Dutch locale_nl.js locale_recurring_nl.js
English locale_en.js - default locale_recurring_en.js - default
Finnish locale_fi.js locale_recurring_fi.js
French locale_fr.js locale_recurring_fr.js
German locale_de.js locale_recurring_de.js
Greek locale_el.js locale_recurring_el.js
Hebrew locale_he.js locale_recurring_he.js
Hungarian locale_hu.js not translated
Indonesian locale_id.js not translated
Italian locale_it.js locale_recurring_it.js
Japanese locale_jp.js not translated
Norwegian locale_no.js not translated
Norwegian Bokmål locale_nb.js locale_recurring_nb.js
Polish locale_pl.js locale_recurring_pl.js
Portuguese locale_pt.js locale_recurring_pt.js
Romanian locale_ro.js locale_recurring_ro.js
Russian locale_ru.js locale_recurring_ru.js
Slovak locale_sk.js locale_recurring_sk.js
Slovenian locale_si.js not translated
Spanish locale_es.js locale_recurring_es.js
Swedish locale_sv.js locale_recurring_sv.js
Turkish locale_tr.js not translated
Ukrainian locale_ua.js locale_recurring_ua.js

Creating custom locale

The easiest way to create a custom locale is to make a copy of the default (English) locale - scheduler/sources/locale/locale.js, and translate all strings from it into the required language.

Note, activating a custom locale in the app will cause changes in the app's interface. Check and redefine (if required) all locale-dependent elements to be sure that the scheduler looks fine in its new language.

You can send your custom locale file to support@dhtmlx.com - so we will include it in the next release.

scheduler.locale = {
    date:{
        month_full:["January", "February", "March", "April", "May", "June", 
            "July", "August", "September", "October", "November", "December"],
        month_short:["Jan", "Feb", "Mar", "Apr", "May", "Jun", 
            "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
        day_full:["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", 
            "Friday", "Saturday"],
        day_short:["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]
    },
    labels:{
        dhx_cal_today_button:"Today",
        day_tab:"Day",
        week_tab:"Week",
        month_tab:"Month",
        new_event:"New event",
        icon_save:"Save",
        icon_cancel:"Cancel",
        icon_details:"Details",
        icon_edit:"Edit",
        icon_delete:"Delete",
        confirm_closing:"",// Your changes will be lost, are your sure?
        confirm_deleting:"Event will be deleted permanently, are you sure?",
        section_description:"Description",
        section_time:"Time period",
        full_day:"Full day",
 
        /*recurring events*/
        confirm_recurring:"Do you want to edit the whole set of repeated events?",
        section_recurring:"Repeat event",
        button_recurring:"Disabled",
        button_recurring_open:"Enabled",
        button_edit_series:"Edit series",
        button_edit_occurrence:"Edit occurrence",
 
        /*agenda view extension*/
        agenda_tab:"Agenda",
        date:"Date",
        description:"Description",
 
        /*year view extension*/
        year_tab:"Year",
 
        /* week agenda extension */
        week_agenda_tab:"Agenda",
 
        /*grid view extension*/
        grid_tab:"Grid",
 
        /* touch tooltip*/
        drag_to_create:"Drag to create",
        drag_to_move:"Drag to move",
 
        /* dhtmlx message default buttons */
        message_ok:"OK",
        message_cancel:"Cancel",
 
        /* wai aria labels for non-text controls */
        next:"Next",
        prev:"Previous",
        year:"Year",
        month:"Month",
        day:"Day",
        hour:"Hour",
        minute:"Minute"
    }
};

In case of recurring events, it requires a bit more complex operation. In addition to the above step, you will need to made a copy of the sources/repeat_template.html file and translate all text messages in it to the target language. After that, the translated html file needs converting in a single-line js string

$source = "repeat_template_".$lang[$i].".html";
$target = "locale_recurring_".$lang[$i].".js";
 
$data="";
$data.="scheduler.__recurring_template='".preg_replace("|[\t ]+|"," ",
preg_replace("|[\r\n]+|","",file_get_contents($source)))."';\n\n";
file_put_contents(target,$data)."\n\n";

To make things simpler, you can send the translated HTML form to support@dhtmlx.com, and we will reply with a converted js file (and include the translation into the next release).

Related sample:  Localization

Additional notes

  • If the confirm_closing or confirm_deleting label is not defined, the related confirm dialog will not be shown at all (auto-confirm);
  • The section_{name} label refers to the lightbox section of the related name.
  • The new_event label defines the default text of a new event.
Back to top