Localization in dnn-creating globally-used programs

Source: Internet
Author: User
Tags dnn

We often see corresponding Language Pack downloads on dnn websites. By downloading and installing the Language Pack, you can use the dnn application.ProgramLocalization effect (we usually call it localization ). Now let's see how dnn is localized. (It is too difficult to clearly explain the entire context of localization. I have not been able to clearly express the language after several days of organization, I can only list several concepts, hoping to help you read these concepts)

Principle:

All pages in dnn are composed of user controls. Localized applications only need to localize each user control. All the resources that are localized to the control are in the corresponding resource file.

Several related terms (some of the frequently used terms in dnn program localization do not know if they are translated by themselves ):
Resourcefileroot:The basic name of the local resource file.
For example, globalresources. resx is a basic name.
Other localized resource files for globalresources can be named globalresources. zh-CN.resx (Chinese)
The name of the globalresources site-level localization resource file can be globalresources. zh-CN.Portal-0.resx (Chinese)
Resourcekey:Search for the key of a specific localized content in the resource file
Region information:You can select the region information when registering a user or on the site. It is the basis for determining the language interface to be presented. For example:

When an application is loaded, the program determines the language of the interface based on the region information of the registered user, the region information of the accessed site, and the default region information of the system (En-US. It is precisely because this sequence shows why some people who have installed the Language Pack have not obtained the customized interface. This is mainly because the site and user language are not set to the specified regional language.

The order in which the local resource files are read:First read site-level localization resource files (e.g.: *. zh-CN.Portal-0.resx) --> host-level localization resource files (e.g.: *. zh-CN.resx) --> system default (e.g.: *. resx ). In addition, you can set a backup language (fallback) for each language. When the first language localized resource file fails to be loaded, you can load the localized resource file of the backup language. This function program does not provide an operation interface and can only be modified in the locales. xml file. For example, I set the first language of Chinese to ZH-CH (Simplified Chinese) and the backup language to ZH-TW (Traditional Chinese ). When a control does not have resource files in simplified Chinese, it searches for resource files in Traditional Chinese.

<? XML version = "1.0" encoding = "UTF-8" ?>
< Root >
< Language Name = "English" Key = "En-us" Fallback = ""   />
< Language Name = "Deutsch" Key = "De-de" Fallback = "En-us"   />
< Language Name = "Chinese" Key = "ZH-CN" Fallback = "ZH-tw"   />
</ Root >

Content of the Language Pack:(The content of the Language Pack is distributed in the corresponding app_globalresources folder)
Global Language Pack(Only list resourcefileroot, and the corresponding. ZH-ch is a localized resource file)
Globalresources. resx: stores localized menu information.
Sharedresources. resx: stores information about common page controls, such as localized buttons and prompt information.
Timezones. xml: stores time zone information.

Module Language Pack file:(The user module is also a third-party module, under each app_globalresources folder in desktopmodules)
Control Language Pack file:(General user control, under each app_globalresources folder in controls)
Manage Language Pack files:(The management module is the functional module for implementing website background management, under the app_globalresources folder in admin)

Local programs:
The user controls used to operate language packs in the admin/localization file implement all the language management functions under host management. These controls include: creating language packs (ages. ascx), edit the Language Pack (languageeditor. ascx) to generate a Language Pack (languagepack. ascx), edit the time zone information (timezoneeditor. ascx), verify the Language Pack to check the integrity of the local file (resourceverifier. ascx ).

Existing problems:
The programs provided by dnn can adapt to globalization. The third-party controls we developed can also be used as global controls. But how does the website content built in dnn become global. For example, if I create a new tag home, I need Chinese users to access the "Homepage" from time to time, while American users access the "home ". The same is true for the content on the page. How can we solve this problem? I want to check whether the user module controls should be taken into account during development. Select a language when you add a module. Enter different content in different languages. That is to say, for example, if I add a text/html module and input a piece of content, I can select the desired one for the presentation of multiple language versions at the same time.

Tutorials on how to install language packs are available on the Chinese dnn website.
The related knowledge of globalization and localization is described in msdn.
More>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.