eWebEditor Home >> eWebEditor Manual V11.2 >> Developer Guide >> Custom Function >> Add a Language

3.9.2.5 Modify supported languageoptions

After adding language character files and language style files, you must modify some system code to call the newly added language package.

There are two places needed to modify. One is to add option for client examination, the other is to add option for server visualized configuration.

1. Add option for client examination

Open ewebeditor/js/lang.js with notebook or other textual editor and find the following code.

var AvailableLangs = new Object() ;

AvailableLangs["en"]   = true ;

AvailableLangs["zh-cn"]     = true ;

AvailableLangs["zh-tw"]     = true ;

Append the following line to the code segment.

AvailableLangs["yourlanguagecode"] = true ;

Note: the blue part is the language code you find in the corresponding table of language codes and countries.

2. Add option for server's visible configuration

Open ewebeditor/admin/style.asp (.aspx/.php/.jsp) with notebook or other textual editor and find the following code.

ASP/ASP.NET:

s_FormDefaultLanguage = InitSelect("d_defaultlanguage", Split("Simplified Chinese|Traditional Chinese|English ", "|"), Split("zh-cn|zh-tw|en", "|"), sDefaultLanguage, "", "")

PHP:

$s_FormDefaultLanguage = InitSelect("d_defaultlanguage", explode("|", "Simplified Chinese|Traditional Chinese|English "), explode("|", "zh-cn|zh-tw|en"), $GLOBALS["sDefaultLanguage"], "", "");

JSP:

s_FormDefaultLanguage = GetSelect("d_defaultlanguage", split("Simplified Chinese|Traditional Chinese|English ", "|"), split("zh-cn|zh-tw|en", "|"), sDefaultLanguage, "");

Modify the code of the blue part above and add language description and language code. Several options should be separated by "|". Save the configurations after modifications.