Soluling home   Document home

Multiple Script Languages

Most languages in the world are written in one way using one script. For example, English is always written in Latin alphabets, Greek is written in Greek alphabets, Russian is written in Cyrillic alphabets, and Japanese is written in Japanese characters. However, there are some languages that can be written in two or more scripts. For example, Chinese is written in both Simplified Chinese characters and Traditional Chinese characters. Serbian is written mostly in Cyrillic alphabets, but it can also be written in Latin alphabets.

When dealing with a single script language, such as as English is easy because the language code also specifies the script. This means that we do not have to identify the English language as en-Latn. Instead, we can just identify English as en. Things get more complicated with multi-script languages. For example, if we identified Chinese as zh, would it be Simplified or Traditional Chinese? If fact, it can be both. If a multi-script language id is without a script part, the language is ambiguous. We have two choices here. The first is to add a script part into the language id. So zh would be zh-Hans or zh-Hant. Hans means Simplified Chinese script. Hant means Traditional Chinese script. Adding a script id into the language id makes the language id unambiguous. The second option is to decide the default script of the language. This means that if there is a language id without script id then the system would apply the default script of the language. In the case of Chinese, Simplified Chinese is the default script. So zh would be the same as zh-Hans.

In some cases of multi-script languages, only one script is used in one region, and the other script is used in another region. For example, Simplified Chinese is used only in the People's Republic of China and Singapore. Traditional Chinese is used in Taiwan, Hong Kong, and Macau. This makes it unnecessary to use the script id in the case we have a locale id with language and country. So instead of zh-Hans-CN, we can use just zh-CN. Similarly, instead of zh-Hant-TW we can use zh-TW. This applies only to those languages where only one script is used in one region. In the case of Serbian, where both Cyrillic and Latin are used in Serbia, we still have to use script codes. So sr-Cyrl-SP would mean Serbian, Cyrillic (Serbia), and sr-Latn-SP would mean Serbian, Latin (Serbia). If we use Cyrillic as the default script then the code would be sr-SP and sr-Latn-SP.

The following table show all multi-script languages:

Language Default script Additional script Un​ambiguous if with country Notes
Azeri Latin Cyrillic No  
Bosnian Latin Cyrillic No  
Chinese Simplified Traditional Yes Simplified is used in the People's Republic of China and Singapore. Traditional is used in Taiwan, Hong Kong, and Macau.
Inuktitut Latin Inuktitut No  
Mongolian Cyrillic Mongolian Yes Cyrillic is used in Mongolia. Mongolian script is used in the People's Republic of China.
Serbian Cyrillic Latin No  
Uzbek Latin Cyrillic No  

Soluling uses the default script approach. This means that the script part is not used if the language uses the default script of the language. Simplified Chinese is identified as zh. Traditional Chinese is identified as zh-Hant. Chinese (PRC) is identified as zh-CN. Chinese (Taiwan) is identified as zh-TW.

.NET

.NET does not use default script, but an id without script can be used with all scripts of the language. This means that zh means both Simplified Chinese and Traditional Chinese. This is why .NET also allows you to create resource files that use language id without a script. .NET uses these resource files with all script variants of the language. This may lead to an error. For example, if you have zh\MyApp.resources.dll that contains Traditional Chinese, and you run the application on Simplified Chinese you will get the wrong Chinese. To prevent this, Soluling, by default, adds the script part into the language id of .NET if the language uses multiple scripts. So Soluling would create zh-Hant\MyApp.resources.dll instead of zh\MyApp.resources.dll. If you want to make resource files without a script if you have to change the settings.