The last time yglad was introduced, it supports multiple languages. I configured it yesterday. The method is simple. The default configuration file is data. xml. To support multiple languages, add the code Suffix of the language. For example, if the Chinese character is ZH, add data. Zh. xml.
The process for displaying multiple languages is as follows:
Yglad reads the currently set language code. This ISO 2 letter language codes is based on ISO 639-1 and represents a language with two characters. The complete code list is as follows:
Language |
Code |
Abkhazian |
AB |
Afar |
AA |
Afrikaans |
AF |
Albanian |
SQ |
Amharic |
AM |
Arabic |
Ar |
Armenian |
Hy |
Assamese |
As |
Aymara |
Ay |
Azerw.jani |
AZ |
Bashkir |
Ba |
Basque |
EU |
Bengali, Bangla |
BN |
Bhutani |
DZ |
Bihari |
BH |
Bislama |
Bi |
Breton |
BR |
Bulgarian |
BG |
Burmese |
My |
Byelorussian |
Be |
Cambodian |
Km |
Catalan |
CA |
Chinese |
ZH |
Corsican |
CO |
Croatian |
HR |
Czech |
CS |
Danish |
Da |
Dutch |
NL |
English, American |
En |
Esperanto |
EO |
Estonian |
Et |
Faeroese |
Fo |
Fiji |
FJ |
Finnish |
Fi |
French |
FR |
Frisian |
FY |
Gaelic (Scots Gaelic) |
GD |
Galician |
GL |
Georgian |
Ka |
German |
De |
Greek |
El |
Greenlandic |
KL |
Guarani |
GN |
Gujarati |
Gu |
Hausa |
Ha |
Hebrew |
IW |
Hindi |
Hi |
Hungarian |
Hu |
Icelandic |
Is |
Indonesian |
In |
Interlingua |
IA |
Interlingue |
IE |
Inupiak |
Ik |
Irish |
GA |
Italian |
It |
Japan |
Ja |
Javanese |
JW |
Kannada |
KN |
Kashmiri |
KS |
Kazakh |
Kk |
Kinyarwanda |
RW |
Kirghiz |
Ky |
Kirundi |
Rn |
Korean |
Ko |
Kurdish |
Ku |
Laothian |
Lo |
Latin |
La |
Latvian, lettish |
LV |
Lingala |
Ln |
Lithuanian |
Lt |
Macedonian |
Mk |
Malagasy |
MG |
Malay |
MS |
Malayalam |
ML |
Maltese |
Mt |
Maori |
Mi |
Marathi |
Mr |
Moldavian |
Mo |
Mongolian |
Mn |
Nauru |
Na |
Nepali |
Ne |
Norwegian |
No |
Occitan |
OC |
Oriya |
Or |
Oromo, afan |
Om |
Pashto, pushto |
PS |
Persian |
Fa |
Polish |
PL |
Portuguese |
PT |
Punjabi |
Pa |
Quechua |
Qu |
Rhaeto-romance |
Rm |
Romanian |
Ro |
Russian |
Ru |
Samoan |
Sm |
Sangro |
SG |
Sanskrit |
SA |
Serbian |
Sr |
Serbo-Croatian |
Sh |
Sesotho |
St |
Setswana |
TN |
Shona |
Sn |
Sindhi |
SD |
Singhalese |
Si |
Siswati |
SS |
Slovak |
SK |
Slovenian |
SL |
Somali |
So |
Spanish |
Es |
Sudanese |
Su |
Swahili |
SW |
Swedish |
SV |
Tagalog |
TL |
Tajik |
TG |
Tamil |
Ta |
Tatar |
TT |
Tegulu |
Te |
Thai |
Th |
Tibetan |
Bo |
Tigrinya |
Ti |
Tonga |
To |
Tsonga |
TS |
Turkish |
Tr |
Turkmen |
TK |
Twi |
TW |
Ukrainian |
UK |
Urdu |
UR |
Uzbek |
Uz |
Vietnamese |
VI |
Volapuk |
Vo |
Welsh |
Cy |
Wolof |
Wo |
Xhosa |
XH |
Yiddish |
Ji |
Yoruba |
Yo |
Zulu |
Zu |
In practical applications, the complete country/region code and cultureinfo classes are as follows: ZH-CN, ZH-tw ...... There are several different types of Chinese. How can we distinguish between Simplified Chinese and Traditional Chinese?
After downloading the source code of yglad, you can find the code for reading the language settings. In localizationhelper. CS:
var language = culture.TwoLetterISOLanguageName;
It is read here. Since we want the complete cultureinfo code, we can make the following modifications:
var language = culture.Name;
Re-compile and update references to differentiate ZH-CN and ZH-TW. The corresponding configuration file is changed to data. zh-CN.xml and data. zh-TW.xml.
I mentioned this issue in the codeplex project discussion. The author said that the following changes will be made:
First, read the current country/region settings, that is, the method I modified. If there is no localized country/region code, read the language code of course, that is, the current method of yglad, if no localized language code is found, use the default settings.
He mentioned that the difference between some country/region may be very small or almost none, such as de-at and de-de, so as to set a data.de. XML. If some country/region have a big difference, such as ZH-CN and ZH-TW, you can set different configuration files as needed. This is more flexible.