Multi-Language Project

  1. Multi-Language project must use utf-8 for everything. The charset of the project must be "utf-8".
  2. The data in your database must be stored in unicode, otherwise your data will not be displayed properly.
  3. If you have to customize the template and put unicode characters directly in the template instead of using language file, always use utf-8 encoding and enable the Advanced Setting UTF-8 output files (see Customizing Template and Tools).
  4. Only the English language file is provided by our products, you'll need to prepare the language files for other languages yourself. You may also check our website and see if there are any user submitted language files. If you want to share your language files with others (without any conditions), you can submit your language file to us too.


Making Language Files

Language files are placed in the subfolder "languages" under the installed folder. The files are used for all templates.

To translate a language, duplicate the shipped english.xml and rename it. It is recommended that the file name should contain alphanumeric characters (and underscore) and in lowercase only.

  1. Open the new XML file with any text or XML editor, you'll see the root node:

    <ew-language date="2018/01/08" version="11.0.0" id="en" name="English" desc="English" author="e.World Technology Ltd.">

    You must change at least the id, name and desc attributes.

    The id is an identifier for identifying the language in generated scripts, it must be unique. It is recommended that you use the following values as the language IDs.

    Language Value
    Arabic ar
    Bengali bn
    Bulgarian bg
    Catalan ca
    Chinese (Simplified) zh-CN
    Chinese (Traditional) zh-TW
    Croatian hr
    Czech cs
    Danish da
    Dutch nl
    English (UK) en-GB
    English (US) en
    Estonian et
    Filipino fil
    Finnish fi
    French fr
    French (Canadian) fr-CA
    German de
    Gujarati gu
    Language Value
    German (Austria) de-AT
    German (Switzerland) de-CH
    Greek el
    Hebrew iw
    Hindi hi
    Hungarain hu
    Indonesian id
    Italian it
    Japanese ja
    Kannada kn
    Korean ko
    Latvian lv
    Lithuanian lt
    Malay ms
    Malayalam ml
    Marathi mr
    Norwegian no
    Persian fa
    Polish pl
    Language Value
    Portuguese pt
    Portuguese (Brazil) pt-BR
    Portuguese (Portugal) pt-PT
    Romanian ro
    Russian ru
    Serbian sr
    Slovak sk
    Slovenian sl
    Spanish es
    Spanish (Latin America) es-419
    Swedish sv
    Tamil ta
    Telugu te
    Thai th
    Turkish tr
    Ukrainian uk
    Urdu ur
    Vietnamese vi

    The name is for displaying the language name in the user interface (which does not support unicode), it should contain alphanumeric characters, underscore and spaces only.

    The desc is for displaying the language name in generated scripts, it can be in the encoding of the XML file.

    For example, if you want to make language file for Traditional Chinese, you may rename the file as chinese.xml and modify the node as:

    <ew-language date="2018/01/08" version="11.0.0" id="zh-TW" name="Traditional Chinese" desc="繁體中文" author="e.World Technology Ltd.">

  2. Each language file should have a corresponding locale file with the same language ID. See:

    1. Customizing Template -> Locale Files, and
    2. Tools -> Locale Settings
  3. You can edit or even add your own phrases. Just open the language file with any text or XML editor, edit/add your <phrase> nodes. Make sure you provide an unique id to each phrase. The id must be alphanumerical only.

    The phrases are not limited to text, you can also use HTML, e.g.

    <phrase id="FieldRequiredIndicator" value="&lt;span class=&quot;ew-required&quot;&gt;&amp;nbsp;*&lt;/span&gt;"/>

    If you want to use an image instead of text for a phrase, you can use the "imageurl", "imagewidth" and "imageheight" attributes, e.g.

    <phrase id="UnmatchedValue" value="Value does not exist" imageurl="{_images}/warn.gif" imagewidth="16" imageheight="15"/>

    where {_images} is the image folder defined in control.xml, by default it is "phpimages", you should place your own images in the generated image subfolder. Alternatively, you can put your images in the "images" subfolder of the template.

  4. Language file is an XML file, when you edit the file, make sure that you keep it well-formed. If you use HTML tags or special characters in the attributes of the XML tags, you need to use entity references. For example, to insert the > symbol, you need to use &lt;. Make sure your characters are supported by the encoding of the XML file specified in the processing instruction node (the first line). You can load the file in your browser to check if the file is well-formed, if it is, the browsers should be able to load and display it without any errors.

Note DO NOT use old language files from previous versions directly or the new phrases will be missing. You should compare the English version of the language files from old and new version and then add the new phrases to your new language file.

Selecting Language Files for Project

Click [Tools] -> [Languages] to select the languages you want to use in the project. If more than one language is selected, a combobox will appear on the top of the generated scripts for user to select language.


Enabling Multi-Language and Selecting Default Language

If you want to use multi-language project, make sure you have enabled Multi-Language in the [PHP]->[General] tab (see PHP Settings).

Then, select a Default Language in the [PHP]->[General] tab (see PHP Settings).


Multi-Language Property Editor

Note If you use single language, you do NOT need to use this editor, just enter your phrases in the general user interface. Only use this editor if you use Multi-Language.

Some text properties support Multi-Language. This editor allows you to enter your property values for each language. Supported properties are:

  • Table/Field Captions
  • Field Error Message
  • Chart Caption
  • Chart X Axis Title
  • Chart Y Axis Title
  • Chart Primary Y Axis Title
  • Chart Secondary Y Axis Title
  • Menu Text
  • Site Title and Footer Text

To edit these properties, click [Tools] -> [Multi-Language Property Editor] to open the editor. Alternatively, you can also click the small button next to above properties in the user interface to open.

Select a property in the Property pane on the left to edit, then enter your properties in unicode. For example, you can copy and paste from Word.

The editor supports import/export of the phrases (of the mutli-language properties only, not including the phrases in the language files):

Click the export button to export the phrases to a XML file so you can edit the file with text or XML editor or share the file with other project. Click thie import button to choose the XML file that you want to import so you can quicky use edited phrases or easily reuse other project's XML file.

Note Previously saved properties are displayed in bold font. Once you use this editor to save your unicode text, the saved unicode property values will always be used prior to the original property values (in the general user interface) . The original property value will only be used if unicode property value of the language cannot be found. If you want to edit the property, always go back to this editor. After editing and saving unicode properties, remember to re-generate the languages file and upload them again.


Using Server Events

If you prefer to customize the language phrases by code, you can use the Language_Load server event. You can use the global function CurrentLanguageID() to get the current language ID and write your code accordingly. See Server Events and Client Scripts for more details.



 ©2007-2018 e.World Technology Ltd. All rights reserved.