Setting language

Home > Basic examples > Example 16

Explanation

DEXTUploadX5 is a component based on Korean language. However, if the language value that can be obtained from the browser's navigator object is not Korean, it looks for a suitable resource. (Navigator.language, navigator.browserLanguage, navigator.systemLanguage). Therefore, if you are interested in multilingual environment, you have to create and register the language resource you want to support.

# The DEXTUploadX5 resource location contains Korean, English, Japanese, and Chinese message resources by default. 
dextuploadx5-svg-message-ko.txt
dextuploadx5-svg-message-en.txt
dextuploadx5-svg-message-ja.txt
dextuploadx5-svg-message-zh.txt
# If you want to use another language resource, you must register the appropriate language resource in the same location. 
dextuploadx5-svg-message-fr.txt

When you create a component using the dx5.create function, you can force the language resource to be used. Once a language is set, the component looks for the appropriate language resource, regardless of the browser language.

// Automatically select the language.
dx5.create({ id: "dext5-1", parentId: "dext5-container1" });
// Set to Korean.
dx5.create({ id: "dext5-2", parentId: "dext5-container2", lang: "ko" });
// Set to English.
dx5.create({ id: "dext5-3", parentId: "dext5-container3", lang: "en" });
// Set to Japanese. 
dx5.create({ id: "dext5-4", parentId: "dext5-container4", lang: "ja" });
// Set to Chinese. 
dx5.create({ id: "dext5-5", parentId: "dext5-container5", lang: "zh" });

If no resource supports the browser's language, the built-in English resource is used.

Example

Auto

Korean

English

Japanese

Chinese