1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #include <sal/config.h>
25 #include <utilities.hxx>
30 const size_t MAX_RES_STRING
= 1024;
31 const wchar_t SPACE_CHAR
= L
' ';
33 static std::wstring
StringToWString(const std::string
& String
, int codepage
)
35 int len
= MultiByteToWideChar(
36 codepage
, 0, String
.c_str(), -1, nullptr, 0);
38 wchar_t* buff
= static_cast<wchar_t*>(
39 _alloca(len
* sizeof(wchar_t)));
42 codepage
, 0, String
.c_str(), -1, buff
, len
);
44 return std::wstring(buff
);
47 static std::string
WStringToString(const std::wstring
& String
, int codepage
)
49 int len
= WideCharToMultiByte(
50 codepage
, 0, String
.c_str(), -1, nullptr, 0, nullptr, nullptr);
52 char* buff
= static_cast<char*>(
53 _alloca(len
* sizeof(char)));
56 codepage
, 0, String
.c_str(), -1, buff
, len
, nullptr, nullptr);
58 return std::string(buff
);
62 std::wstring
StringToWString(const std::string
& String
)
64 return StringToWString(String
, CP_ACP
);
68 std::string
WStringToString(const std::wstring
& String
)
70 return WStringToString(String
, CP_ACP
);
74 std::wstring
UTF8ToWString(const std::string
& String
)
76 return StringToWString(String
, CP_UTF8
);
80 std::wstring
GetResString(int ResId
)
82 wchar_t szResStr
[MAX_RES_STRING
];
84 int rc
= LoadStringW( GetModuleHandleW(MODULE_NAME
), ResId
, szResStr
, sizeof(szResStr
) );
86 OutputDebugStringFormatW( L
"GetResString: read %d chars\n", rc
);
87 // OSL_ENSURE(rc, "String resource not found");
89 return std::wstring(szResStr
);
93 /** helper function to judge if the string is only has spaces.
95 <TRUE>if the provided string contains only but at least one space
96 character else <FALSE/>.
99 bool HasOnlySpaces(const std::wstring
& String
)
101 if ( String
.length() == 0 )
104 const wchar_t* p
= String
.c_str();
108 if (*p
++ != SPACE_CHAR
)
116 /** helper function to convert windows paths to short form.
121 std::wstring
getShortPathName( const std::wstring
& aLongName
)
123 std::wstring shortName
= aLongName
;
124 long length
= GetShortPathNameW( aLongName
.c_str(), nullptr, 0 );
128 auto buffer
= std::make_unique
<WCHAR
[]>( length
+1 );
129 length
= GetShortPathNameW( aLongName
.c_str(), buffer
.get(), length
);
131 shortName
= std::wstring( buffer
.get() );
137 /** convert LocaleSet pair into Microsoft List of Locale ID (LCID)
138 according to ISO-639 and ISO-3166.
139 http://etext.lib.virginia.edu/tei/iso639.html
140 http://nl.ijs.si/gnusl/cee/std/ISO_3166.html
144 Windows Locale Identifier corresponding to input LocaleSet.
146 LocaleSet_t myDefaultLocale( ::std::wstring( L"zh" ),::std::wstring(L"HK") );
147 DWORD myLCID = LocaleSetToLCID( myDefaultLocale );
149 _ultow( myLCID, buffer, 16 );
150 MessageBox( NULL, buffer,L"the LCID is:",MB_OK );
153 LCID
LocaleSetToLCID( const LocaleSet_t
& Locale
)
155 if ( EMPTY_LOCALE
== Locale
)
156 return GetSystemDefaultLCID();
158 USHORT usPrimaryLang
= LANG_NEUTRAL
;
159 USHORT usSubLang
=SUBLANG_DEFAULT
;
161 ::std::wstring
wsLanguage(Locale
.first
);
162 ::std::wstring
wsCountry(Locale
.second
);
164 if ( wsLanguage
== L
"ar" )
166 usPrimaryLang
= LANG_ARABIC
; // Arabic 01
168 if ( wsCountry
== L
"SA" )
169 usSubLang
= SUBLANG_ARABIC_SAUDI_ARABIA
; // Arabic (Saudi Arabia)
170 else if ( wsCountry
== L
"IQ" )
171 usSubLang
= SUBLANG_ARABIC_IRAQ
; // Arabic (Iraq)
172 else if ( wsCountry
== L
"EG" )
173 usSubLang
= SUBLANG_ARABIC_EGYPT
; // Arabic (Egypt)
174 else if ( wsCountry
== L
"LY" )
175 usSubLang
= SUBLANG_ARABIC_LIBYA
; // Arabic (Libya)
176 else if ( wsCountry
== L
"DZ" )
177 usSubLang
= SUBLANG_ARABIC_ALGERIA
; // Arabic (Algeria)
178 else if ( wsCountry
== L
"MA" )
179 usSubLang
= SUBLANG_ARABIC_MOROCCO
; // Arabic (Morocco)
180 else if ( wsCountry
== L
"TN" )
181 usSubLang
= SUBLANG_ARABIC_TUNISIA
; // Arabic (Tunisia)
182 else if ( wsCountry
== L
"OM" )
183 usSubLang
= SUBLANG_ARABIC_OMAN
; // Arabic (Oman)
184 else if ( wsCountry
== L
"YE" )
185 usSubLang
= SUBLANG_ARABIC_YEMEN
; // Arabic (Yemen)
186 else if ( wsCountry
== L
"SY" )
187 usSubLang
= SUBLANG_ARABIC_SYRIA
; // Arabic (Syria)
188 else if ( wsCountry
== L
"JO" )
189 usSubLang
= SUBLANG_ARABIC_JORDAN
; // Arabic (Jordan)
190 else if ( wsCountry
== L
"LB" )
191 usSubLang
= SUBLANG_ARABIC_LEBANON
; // Arabic (Lebanon)
192 else if ( wsCountry
== L
"KW" )
193 usSubLang
= SUBLANG_ARABIC_KUWAIT
; // Arabic (Kuwait)
194 else if ( wsCountry
== L
"AE" )
195 usSubLang
= SUBLANG_ARABIC_UAE
; // Arabic (U.A.E.)
196 else if ( wsCountry
== L
"BH" )
197 usSubLang
= SUBLANG_ARABIC_BAHRAIN
; // Arabic (Bahrain)
198 else if ( wsCountry
== L
"QA" )
199 usSubLang
= SUBLANG_ARABIC_QATAR
; // Arabic (Qatar)
201 usSubLang
= SUBLANG_DEFAULT
; //default sub language
203 else if ( wsLanguage
== L
"bg" )
204 usPrimaryLang
= LANG_BULGARIAN
; //Bulgarian 02
205 else if ( wsLanguage
== L
"ca" )
206 usPrimaryLang
= LANG_CATALAN
; //Catalan 03
207 else if ( wsLanguage
== L
"zh" )
209 usPrimaryLang
= LANG_CHINESE
; //Chinese
210 if ( wsCountry
== L
"TW" )
211 usSubLang
= SUBLANG_CHINESE_TRADITIONAL
; // Chinese (Traditional)
212 else if ( wsCountry
== L
"CN" )
213 usSubLang
= SUBLANG_CHINESE_SIMPLIFIED
; // Chinese (Simplified)
214 else if ( wsCountry
== L
"HK" )
215 usSubLang
= SUBLANG_CHINESE_HONGKONG
; // Chinese (Hong Kong SAR, PRC)
216 else if ( wsCountry
== L
"SG" )
217 usSubLang
= SUBLANG_CHINESE_SINGAPORE
; // Chinese (Singapore)
218 else if ( wsCountry
== L
"MO" )
219 usSubLang
= SUBLANG_CHINESE_MACAU
; // Chinese (Macau SAR)
221 usSubLang
= SUBLANG_DEFAULT
; //default sub language
223 else if ( wsLanguage
== L
"cs" )
224 usPrimaryLang
= LANG_CZECH
; //Czech
225 else if ( wsLanguage
== L
"da" )
226 usPrimaryLang
= LANG_DANISH
; //Danish
227 else if ( wsLanguage
== L
"de" )
229 usPrimaryLang
= LANG_GERMAN
; //German
230 if ( wsCountry
== L
"DE" )
231 usSubLang
= SUBLANG_GERMAN
; // German
232 else if ( wsCountry
== L
"CH" )
233 usSubLang
= SUBLANG_GERMAN_SWISS
; // German (Swiss)
234 else if ( wsCountry
== L
"AT" )
235 usSubLang
= SUBLANG_GERMAN_AUSTRIAN
; // German (Austrian)
236 else if ( wsCountry
== L
"LU" )
237 usSubLang
= SUBLANG_GERMAN_LUXEMBOURG
; // German (Luxembourg)
238 else if ( wsCountry
== L
"LI" )
239 usSubLang
= SUBLANG_GERMAN_LIECHTENSTEIN
; // German (Liechtenstein)
241 usSubLang
= SUBLANG_DEFAULT
; //default sub language
243 else if ( wsLanguage
== L
"el" )
244 usPrimaryLang
= LANG_GREEK
; //Greek
245 else if ( wsLanguage
== L
"en" )
247 usPrimaryLang
= LANG_ENGLISH
; //English
248 if ( wsCountry
== L
"US" )
249 usSubLang
= SUBLANG_ENGLISH_US
; // English (US)
250 else if ( wsCountry
== L
"GB" )
251 usSubLang
= SUBLANG_ENGLISH_UK
; // English (UK)
252 else if ( wsCountry
== L
"AU" )
253 usSubLang
= SUBLANG_ENGLISH_AUS
; // English (Australian)
254 else if ( wsCountry
== L
"CA" )
255 usSubLang
= SUBLANG_ENGLISH_CAN
; // English (Canadian)
256 else if ( wsCountry
== L
"NZ" )
257 usSubLang
= SUBLANG_ENGLISH_NZ
; // English (New Zealand)
258 else if ( wsCountry
== L
"IE" )
259 usSubLang
= SUBLANG_ENGLISH_EIRE
; // English (Ireland)
260 else if ( wsCountry
== L
"ZA" )
261 usSubLang
= SUBLANG_ENGLISH_SOUTH_AFRICA
; // English (South Africa)
262 else if ( wsCountry
== L
"JM" )
263 usSubLang
= SUBLANG_ENGLISH_JAMAICA
; // English (Jamaica)
264 else if ( wsCountry
== L
"GD" )
265 usSubLang
= SUBLANG_ENGLISH_CARIBBEAN
; // English (Caribbean) Grenada
266 else if ( wsCountry
== L
"BZ" )
267 usSubLang
= SUBLANG_ENGLISH_BELIZE
; // English (Belize)
268 else if ( wsCountry
== L
"TT" )
269 usSubLang
= SUBLANG_ENGLISH_TRINIDAD
; // English (Trinidad)
270 else if ( wsCountry
== L
"ZW" )
271 usSubLang
= SUBLANG_ENGLISH_ZIMBABWE
; // English (Zimbabwe)
272 else if ( wsCountry
== L
"PH" )
273 usSubLang
= SUBLANG_ENGLISH_PHILIPPINES
; // English (Philippines)
275 usSubLang
= SUBLANG_DEFAULT
; //default sub language
277 else if ( wsLanguage
== L
"es" )
279 usPrimaryLang
= LANG_SPANISH
; //Spanish
280 if ( wsCountry
== L
"MX" )
281 usSubLang
= SUBLANG_SPANISH_MEXICAN
; // Spanish (Mexican)
282 else if ( wsCountry
== L
"ES" )
283 usSubLang
= SUBLANG_SPANISH_MODERN
; // Spanish (Spain)
284 else if ( wsCountry
== L
"GT" )
285 usSubLang
= SUBLANG_SPANISH_GUATEMALA
; // Spanish (Guatemala)
286 else if ( wsCountry
== L
"CR" )
287 usSubLang
= SUBLANG_SPANISH_COSTA_RICA
; // Spanish (Costa Rica)
288 else if ( wsCountry
== L
"PA" )
289 usSubLang
= SUBLANG_SPANISH_PANAMA
; // Spanish (Panama)
290 else if ( wsCountry
== L
"DO" )
291 usSubLang
= SUBLANG_SPANISH_DOMINICAN_REPUBLIC
; // Spanish (Dominican Republic)
292 else if ( wsCountry
== L
"VE" )
293 usSubLang
= SUBLANG_SPANISH_VENEZUELA
; // Spanish (Venezuela)
294 else if ( wsCountry
== L
"CO" )
295 usSubLang
= SUBLANG_SPANISH_COLOMBIA
; // Spanish (Colombia)
296 else if ( wsCountry
== L
"PE" )
297 usSubLang
= SUBLANG_SPANISH_PERU
; // Spanish (Peru)
298 else if ( wsCountry
== L
"AR" )
299 usSubLang
= SUBLANG_SPANISH_ARGENTINA
; // Spanish (Argentina)
300 else if ( wsCountry
== L
"EC" )
301 usSubLang
= SUBLANG_SPANISH_ECUADOR
; // Spanish (Ecuador)
302 else if ( wsCountry
== L
"CL" )
303 usSubLang
= SUBLANG_SPANISH_CHILE
; // Spanish (Chile)
304 else if ( wsCountry
== L
"UY" )
305 usSubLang
= SUBLANG_SPANISH_URUGUAY
; // Spanish (Uruguay)
306 else if ( wsCountry
== L
"PY" )
307 usSubLang
= SUBLANG_SPANISH_PARAGUAY
; // Spanish (Paraguay)
308 else if ( wsCountry
== L
"BO" )
309 usSubLang
= SUBLANG_SPANISH_BOLIVIA
; // Spanish (Bolivia)
310 else if ( wsCountry
== L
"SV" )
311 usSubLang
= SUBLANG_SPANISH_EL_SALVADOR
; // Spanish (El Salvador)
312 else if ( wsCountry
== L
"HN" )
313 usSubLang
= SUBLANG_SPANISH_HONDURAS
; // Spanish (Honduras)
314 else if ( wsCountry
== L
"NI" )
315 usSubLang
= SUBLANG_SPANISH_NICARAGUA
; // Spanish (Nicaragua)
316 else if ( wsCountry
== L
"PR" )
317 usSubLang
= SUBLANG_SPANISH_PUERTO_RICO
; // Spanish (Puerto Rico)
319 usSubLang
= SUBLANG_DEFAULT
; //default sub language
321 else if ( wsLanguage
== L
"fi" )
322 usPrimaryLang
= LANG_FINNISH
; //Finnish
323 else if ( wsLanguage
== L
"fr" )
325 usPrimaryLang
= LANG_FRENCH
; //French
326 if ( wsCountry
== L
"FR" )
327 usSubLang
= SUBLANG_FRENCH
; // French
328 else if ( wsCountry
== L
"BE" )
329 usSubLang
= SUBLANG_FRENCH_BELGIAN
; // French (Belgian)
330 else if ( wsCountry
== L
"CA" )
331 usSubLang
= SUBLANG_FRENCH_CANADIAN
; // French (Canadian)
332 else if ( wsCountry
== L
"CH" )
333 usSubLang
= SUBLANG_FRENCH_SWISS
; // French (Swiss)
334 else if ( wsCountry
== L
"LU" )
335 usSubLang
= SUBLANG_FRENCH_LUXEMBOURG
; // French (Luxembourg)
336 else if ( wsCountry
== L
"MC" )
337 usSubLang
= SUBLANG_FRENCH_MONACO
; // French (Monaco)
339 usSubLang
= SUBLANG_DEFAULT
; //default sub language
341 else if ( wsLanguage
== L
"iw" )
342 usPrimaryLang
= LANG_HEBREW
; //Hebrew
343 else if ( wsLanguage
== L
"hu" )
344 usPrimaryLang
= LANG_HUNGARIAN
; //Hungarian
345 else if ( wsLanguage
== L
"is" )
346 usPrimaryLang
= LANG_ICELANDIC
; //Icelandic
347 else if ( wsLanguage
== L
"it" )
349 usPrimaryLang
= LANG_ITALIAN
; //Italian
350 if ( wsCountry
== L
"IT" )
351 usSubLang
= SUBLANG_ITALIAN
; // Italian
352 else if ( wsCountry
== L
"CH" )
353 usSubLang
= SUBLANG_ITALIAN_SWISS
; // Italian (Swiss)
355 usSubLang
= SUBLANG_DEFAULT
; //default sub language
357 else if ( wsLanguage
== L
"ja" )
358 usPrimaryLang
= LANG_JAPANESE
; //Japanese
359 else if ( wsLanguage
== L
"ko" )
361 usPrimaryLang
= LANG_KOREAN
; //Korean
362 if ( wsCountry
== L
"KR" )
363 usSubLang
= SUBLANG_KOREAN
; // Korean
365 usSubLang
= SUBLANG_DEFAULT
; //default sub language
367 else if ( wsLanguage
== L
"nl" )
369 usPrimaryLang
= LANG_DUTCH
; //Dutch
370 if ( wsCountry
== L
"NL" )
371 usSubLang
= SUBLANG_DUTCH
; // Dutch
372 else if ( wsCountry
== L
"BE" )
373 usSubLang
= SUBLANG_DUTCH_BELGIAN
; // Dutch (Belgian)
375 usSubLang
= SUBLANG_DEFAULT
; //default sub language
377 else if ( wsLanguage
== L
"no" )
379 usPrimaryLang
= LANG_NORWEGIAN
; //Norwegian
380 if ( wsCountry
== L
"NO" )
381 usSubLang
= SUBLANG_NORWEGIAN_BOKMAL
; // Norwegian (Bokmal)
383 usSubLang
= SUBLANG_DEFAULT
; //default sub language
385 else if ( wsLanguage
== L
"pl" )
386 usPrimaryLang
= LANG_POLISH
; //Polish
387 else if ( wsLanguage
== L
"pt" )
389 usPrimaryLang
= LANG_PORTUGUESE
; //Portuguese
390 if ( wsCountry
== L
"BR" )
391 usSubLang
= SUBLANG_PORTUGUESE_BRAZILIAN
; // Portuguese (Brazil)
392 else if ( wsCountry
== L
"PT" )
393 usSubLang
= SUBLANG_PORTUGUESE
; // Portuguese (Portugal)
395 usSubLang
= SUBLANG_DEFAULT
; //default sub language
397 else if ( wsLanguage
== L
"ro" )
398 usPrimaryLang
= LANG_ROMANIAN
; //Romanian
399 else if ( wsLanguage
== L
"ru" )
400 usPrimaryLang
= LANG_RUSSIAN
; //Russian
401 else if ( wsLanguage
== L
"hr" )
402 usPrimaryLang
= LANG_CROATIAN
; //Croatian
403 else if ( wsLanguage
== L
"sr" )
405 usPrimaryLang
= LANG_SERBIAN
; //Serbian
406 if ( wsCountry
== L
"VA" )
407 usSubLang
= SUBLANG_SERBIAN_LATIN
; // Serbian (Latin)
408 else if ( wsCountry
== L
"HR" )
409 usSubLang
= SUBLANG_SERBIAN_CYRILLIC
; // Serbian (Cyrillic)
411 usSubLang
= SUBLANG_DEFAULT
; //default sub language
413 else if ( wsLanguage
== L
"sk" )
414 usPrimaryLang
= LANG_SLOVAK
; //Slovak
415 else if ( wsLanguage
== L
"sq" )
416 usPrimaryLang
= LANG_ALBANIAN
; //Albanian
417 else if ( wsLanguage
== L
"sv" )
419 usPrimaryLang
= LANG_SWEDISH
; //Swedish
420 if ( wsCountry
== L
"SE" )
421 usSubLang
= SUBLANG_SWEDISH
; // Swedish
422 else if ( wsCountry
== L
"FI" )
423 usSubLang
= SUBLANG_SWEDISH_FINLAND
; // Swedish (Finland)
425 usSubLang
= SUBLANG_DEFAULT
; //default sub language
427 else if ( wsLanguage
== L
"th" )
428 usPrimaryLang
= LANG_THAI
; //Thai
429 else if ( wsLanguage
== L
"tr" )
430 usPrimaryLang
= LANG_TURKISH
; //Turkish
431 else if ( wsLanguage
== L
"ur" )
433 usPrimaryLang
= LANG_URDU
; //Urdu
434 if ( wsCountry
== L
"PK" )
435 usSubLang
= SUBLANG_URDU_PAKISTAN
; // Urdu (Pakistan)
436 else if ( wsCountry
== L
"IN" )
437 usSubLang
= SUBLANG_URDU_INDIA
; // Urdu (India)
439 usSubLang
= SUBLANG_DEFAULT
; //default sub language
441 else if ( wsLanguage
== L
"in" )
442 usPrimaryLang
= LANG_INDONESIAN
; //Indonesian
443 else if ( wsLanguage
== L
"uk" )
444 usPrimaryLang
= LANG_UKRAINIAN
; //Ukrainian
445 else if ( wsLanguage
== L
"be" )
446 usPrimaryLang
= LANG_BELARUSIAN
; //Belarusian
447 else if ( wsLanguage
== L
"sl" )
448 usPrimaryLang
= LANG_SLOVENIAN
; //Slovenian
449 else if ( wsLanguage
== L
"et" )
450 usPrimaryLang
= LANG_ESTONIAN
; //Estonian
451 else if ( wsLanguage
== L
"lv" )
452 usPrimaryLang
= LANG_LATVIAN
; //Latvian
453 else if ( wsLanguage
== L
"lt" )
455 usPrimaryLang
= LANG_LITHUANIAN
; //Lithuanian
456 if ( wsCountry
== L
"LT" )
457 usSubLang
= SUBLANG_LITHUANIAN
; // Lithuanian
459 usSubLang
= SUBLANG_DEFAULT
; //default sub language
461 else if ( wsLanguage
== L
"fa" )
462 usPrimaryLang
= LANG_FARSI
; //Farsi
463 else if ( wsLanguage
== L
"vi" )
464 usPrimaryLang
= LANG_VIETNAMESE
; //Vietnamese
465 else if ( wsLanguage
== L
"hy" )
466 usPrimaryLang
= LANG_ARMENIAN
; //Armenian
467 else if ( wsLanguage
== L
"az" )
468 usPrimaryLang
= LANG_AZERI
; //Azeri
469 else if ( wsLanguage
== L
"eu" )
470 usPrimaryLang
= LANG_BASQUE
; //Basque
471 else if ( wsLanguage
== L
"mk" )
472 usPrimaryLang
= LANG_MACEDONIAN
; //FYRO Macedonian
473 else if ( wsLanguage
== L
"af" )
474 usPrimaryLang
= LANG_AFRIKAANS
; //Afrikaans
475 else if ( wsLanguage
== L
"ka" )
476 usPrimaryLang
= LANG_GEORGIAN
; //Georgian
477 else if ( wsLanguage
== L
"fo" )
478 usPrimaryLang
= LANG_FAEROESE
; //Faeroese
479 else if ( wsLanguage
== L
"hi" )
480 usPrimaryLang
= LANG_HINDI
; //Hindi
481 else if ( wsLanguage
== L
"ms" )
483 usPrimaryLang
= LANG_MALAY
; //Malay
484 if ( wsCountry
== L
"MY" )
485 usSubLang
= SUBLANG_MALAY_MALAYSIA
; // Malay (Malaysia)
486 else if ( wsCountry
== L
"BN" )
487 usSubLang
= SUBLANG_MALAY_BRUNEI_DARUSSALAM
; // Malay (Brunei Darassalam)
489 usSubLang
= SUBLANG_DEFAULT
; //default sub language
491 else if ( wsLanguage
== L
"kk" )
492 usPrimaryLang
= LANG_KAZAK
; //Kazakh
493 else if ( wsLanguage
== L
"ky" )
494 usPrimaryLang
= LANG_KYRGYZ
; //Kyrgyz
495 else if ( wsLanguage
== L
"sw" )
496 usPrimaryLang
= LANG_SWAHILI
; //Swahili
497 else if ( wsLanguage
== L
"uz" )
499 usPrimaryLang
= LANG_UZBEK
; //Uzbek
500 if ( wsCountry
== L
"UZ" )
501 usSubLang
= SUBLANG_UZBEK_LATIN
; // Uzbek (Latin)
502 else if ( wsCountry
== L
"DE" )
503 usSubLang
= SUBLANG_UZBEK_CYRILLIC
; // Uzbek (Cyrillic)
505 usSubLang
= SUBLANG_DEFAULT
; //default sub language
507 else if ( wsLanguage
== L
"tt" )
508 usPrimaryLang
= LANG_TATAR
; //Tatar
509 else if ( wsLanguage
== L
"bn" )
510 usPrimaryLang
= LANG_BENGALI
; //Not supported.
511 else if ( wsLanguage
== L
"pa" )
512 usPrimaryLang
= LANG_PUNJABI
; //Punjabi
513 else if ( wsLanguage
== L
"gu" )
514 usPrimaryLang
= LANG_GUJARATI
; //Gujarati
515 else if ( wsLanguage
== L
"or" )
516 usPrimaryLang
= LANG_ORIYA
; //Not supported.
517 else if ( wsLanguage
== L
"ta" )
518 usPrimaryLang
= LANG_TAMIL
; //Tamil
519 else if ( wsLanguage
== L
"te" )
520 usPrimaryLang
= LANG_TELUGU
; //Telugu
521 else if ( wsLanguage
== L
"kn" )
522 usPrimaryLang
= LANG_KANNADA
; //Kannada
523 else if ( wsLanguage
== L
"ml" )
524 usPrimaryLang
= LANG_MALAYALAM
; //Not supported.
525 else if ( wsLanguage
== L
"as" )
526 usPrimaryLang
= LANG_ASSAMESE
; //Not supported.
527 else if ( wsLanguage
== L
"mr" )
528 usPrimaryLang
= LANG_MARATHI
; //Marathi
529 else if ( wsLanguage
== L
"sa" )
530 usPrimaryLang
= LANG_SANSKRIT
; //Sanskrit
531 else if ( wsLanguage
== L
"mn" )
532 usPrimaryLang
= LANG_MONGOLIAN
; //Mongolian
533 else if ( wsLanguage
== L
"gl" )
534 usPrimaryLang
= LANG_GALICIAN
; //Galician
535 else if ( wsLanguage
== L
"sd" )
536 usPrimaryLang
= LANG_SINDHI
; //Not supported.
537 else if ( wsLanguage
== L
"ks" )
538 usPrimaryLang
= LANG_KASHMIRI
; //Not supported.
539 else if ( wsLanguage
== L
"ne" )
540 usPrimaryLang
= LANG_NEPALI
; //Not supported.
542 return GetSystemDefaultLCID(); //System Default Locale
544 return MAKELCID( MAKELANGID( usPrimaryLang
, usSubLang
), SORT_DEFAULT
);
547 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */