Add a Language
A language package of eWebEditor includes a languagecode.js file for defining language character and a languagecode.css file for defining default language interface style. These files are all saved in directory of ewebeditor/language/.
If you cannot find the language package needed in language package provided by us, you can add a language package by the following steps.
Search for language code
Find the language code for your desirous language in the following table.
| Language Code |
Language/Country |
| af |
Afrikaans |
| sq |
Albanian |
| ar-sa |
Arabic (Saudi Arabia) |
| ar-iq |
Arabic (Iraq) |
| ar-eg |
Arabic (Egypt) |
| ar-ly |
Arabic (Libya) |
| ar-dz |
Arabic (Algeria) |
| ar-ma |
Arabic (Morocco) |
| ar-tn |
Arabic (Tunisia) |
| ar-om |
Arabic (Oman) |
| ar-ye |
Arabic (Yemen) |
| ar-sy |
Arabic (Syria) |
| ar-jo |
Arabic (Jordan) |
| ar-lb |
Arabic (Lebanon) |
| ar-kw |
Arabic (Kuwait) |
| ar-ae |
Arabic (U.A.E.) |
| ar-bh |
Arabic (Bahrain) |
| ar-qa |
Arabic (Qatar) |
| eu |
Basque |
| bg |
Bulgarian |
| be |
Belarusian |
| ca |
Catalan |
| zh-tw |
Chinese (Taiwan) |
| zh-cn |
Chinese (PRC) |
| zh-hk |
Chinese (Hong Kong SAR) |
| zh-sg |
Chinese (Singapore) |
| hr |
Croatian |
| cs |
Czech |
| da |
Danish |
| nl |
Dutch (Standard) |
| nl-be |
Dutch (Belgium) |
| en |
English |
| en-us |
English (United States) |
| en-gb |
English (United Kingdom) |
| en-au |
English (Australia) |
| en-ca |
English (Canada) |
| en-nz |
English (New Zealand) |
| en-ie |
English (Ireland) |
| en-za |
English (South Africa) |
| en-jm |
English (Jamaica) |
| en |
English (Caribbean) |
| en-bz |
English (Belize) |
| en-tt |
English (Trinidad) |
| et |
Estonian |
| fo |
Faeroese |
| fa |
Farsi |
| fi |
Finnish |
| fr |
French (Standard) |
| fr-be |
French (Belgium) |
| fr-ca |
French (Canada) |
| fr-ch |
French (Switzerland) |
| fr-lu |
French (Luxembourg) |
| gd |
Gaelic (Scotland) |
| gd-ie |
Gaelic (Ireland) |
| de |
German (Standard) |
| de-ch |
German (Switzerland) |
| de-at |
German (Austria) |
| de-lu |
German (Luxembourg) |
| de-li |
German (Liechtenstein) |
| el |
Greek |
| he |
Hebrew |
| hi |
Hindi |
| hu |
Hungarian |
| is |
Icelandic |
| id |
Indonesian |
| it |
Italian (Standard) |
| it-ch |
Italian (Switzerland) |
| ja |
Japanese |
| ko |
Korean |
| ko |
Korean (Johab) |
| lv |
Latvian |
| lt |
Lithuanian |
| Macedonian |
(FYROM) |
| ms |
Malaysian |
| mt |
Maltese |
| no |
Norwegian (Bokmal) |
| no |
Norwegian (Nynorsk) |
| pl |
Polish |
| pt-br |
Portuguese (Brazil) |
| pt |
Portuguese (Portugal) |
| rm |
Rhaeto-Romanic |
| ro |
Romanian |
| ro-mo |
Romanian (Moldavia) |
| ru |
Russian |
| ru-mo |
Russian (Moldavia) |
| sz |
Sami (Lappish) |
| sr |
Serbian (Cyrillic) |
| sr |
Serbian (Latin) |
| sk |
Slovak |
| sl |
Slovenian |
| sb |
Sorbian |
| es |
Spanish (Spain ? Traditional) |
| es-mx |
Spanish (Mexico) |
| es |
Spanish (Spain ? Modern) |
| es-gt |
Spanish (Guatemala) |
| es-cr |
Spanish (Costa Rica) |
| es-pa |
Spanish (Panama) |
| es-do |
Spanish (Dominican Republic) |
| es-ve |
Spanish (Venezuela) |
| es-co |
Spanish (Colombia) |
| es-pe |
Spanish (Peru) |
| es-ar |
Spanish (Argentina) |
| es-ec |
Spanish (Ecuador) |
| es-cl |
Spanish (Chile) |
| es-uy |
Spanish (Uruguay) |
| es-py |
Spanish (Paraguay) |
| es-bo |
Spanish (Bolivia) |
| es-sv |
Spanish (El Salvador) |
| es-hn |
Spanish (Honduras) |
| es-ni |
Spanish (Nicaragua) |
| es-pr |
Spanish (Puerto Rico) |
| sx |
Sutu |
| sv |
Swedish |
| sv-fi |
Swedish (Finland) |
| th |
Thai |
| ts |
Tsonga |
| tn |
Tswana |
| tr |
Turkish |
| uk |
Ukrainian |
| ur |
Urdu |
| ve |
Venda |
| vi |
Vietnamese |
| xh |
Xhosa |
| ji |
Yiddish |
Different countries in the same phylum can select the commonly used language code in that phylum. For example, both "en-us" and "en-gb" can apply uniform "en". When the program cannot find "en-us" and "en-gb" language package it will automatically use "en" language package as substitute.
Add language character files
Saved in directory of ewebeditor/llanguage/, the language character files are those in "language code"+ ".js" format. File names are all in lowercase. For example, English is "en.js" and simplified Chinese is "zh-ch.js".
To create a new language character file, you can copy, paste and rename a system-provided language character file into a file named "YourLanguageCode.js". Open this file by notebook or other textual editor and save it before replacing all language character strings into your own language character string,
Note: language character file must be saved in "UTF-8" format. For example, in the notebook "save as" dialog box, and the default code is "ANSI". Please select "UTF-8" code and then click on "save".
Add language style files
Saved in directory of ewebeditor/language/, the language style files are those in "language code"+".css" format. File names are all in lowercase. For example, English is "en.css" and simplified Chinese is "zh-ch.css".
Language style files are mainly used to define every language's interface, dialog box, right-key menu, default size and the font name.
For example, the best English interface character size is 8pt while the best Chinese interface character size is 9pt.
Modify supported language options
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.
Completion
Through the above steps, you have finished adding a language package.
|