DHTMLX Docs & Samples Explorer

Localization

Included locales

scheduler include localization for next languages

Language Common locale Recurring events form
English default sources/locale_recurring_en
Chinese sources/locale_cn.js sources/locale_recurring_cn.js
Dutch sources/locale_se.js not translated
Finnish sources/locale_fi.js sources/locale_recurring_fi.js
French sources/locale_fr.js sources/locale_recurring_fr.js
German sources/locale_de.js sources/locale_recurring_de.js
Hebrew sources/locale_he.js not translated
Italian sources/locale_it.js sources/locale_recurring_it.js
Japanese sources/locale_jp.js not translated
Norwegian sources/locale_nl.js sources/locale_recurring_nl.js
Portuguese sources/locale_pt.js sources/locale_recurring_pt.js
Russian sources/locale_ru.js sources/locale_recurring_ru.js
Spanish sources/locale_es.js sources/locale_recurring_es.js

To activate necessary locale - you need to load related js file in additional to existing ones, for example the includes for scheduler with Spanish locale will look as

<script src="../codebase/dhtmlxscheduler.js" type="text/javascript" charset="utf-8"></script>
<link rel="stylesheet" href="../codebase/dhtmlxscheduler.css" type="text/css" title="no title" charset="utf-8">
 
<script src="../sources/locale_es.js" type="text/javascript" charset="utf-8"></script>

Be sure to use charset=“utf-8”, because all locales are stored as UTF-8 text.

If you are using recurring events, one more file need to be included - localized form for recurring events

<script src="../codebase/dhtmlxscheduler.js" type="text/javascript" charset="utf-8"></script>
<link rel="stylesheet" href="../codebase/dhtmlxscheduler.css" type="text/css" title="no title" charset="utf-8">
 
<script src="../sources/locale_es.js" type="text/javascript" charset="utf-8"></script>
<script src="../sources/locale_recurring_es.js" type="text/javascript" charset="utf-8"></script>

Creating custom locale

You can made a copy of sources/locale.js, which is an english version of locale, and translate all strings in it to different language - including such translated js file will change interface of app in necessary way. ( You can send such file to support@dhtmlx.com - so we will include it in 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"
    }
}

In case of reccuring events, it require a bit more complex operation. In addition to above step, you will need to made copy of sources/repeat_template.html and translate all text messages in it to target language. After that , translated html file need to be converted in sinlge 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 made things simpler, if you have translated html form - you can just send it to support@dhtmlx.com - we will reply with converted js file ( and will include translation in next release )

Additional notes

  • If confirm_closing or confirm_deleting is not defined - related confirm dialog will not be shown at all (auto-confirm);
  • section_{name} refers to the section inside details form, with name:{name};
  • new_event - default text of new event.