Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

76 lines
2.7 KiB

  1. /*************************************************************/
  2. /* Name: lcid.cpp
  3. /* Description:
  4. /*************************************************************/
  5. #include <stdafx.h>
  6. #include "mslcid.h"
  7. #include "mswebdvd.h"
  8. #include "msdvdadm.h"
  9. #include "resource.h"
  10. MSLangID::MSLangID() {
  11. static LanguageList LL[] = {
  12. { IDS_INI_LANG1, LANG_AFRIKAANS },
  13. { IDS_INI_LANG2, LANG_ALBANIAN },
  14. { IDS_INI_LANG3, LANG_ARABIC },
  15. { IDS_INI_LANG4, LANG_BASQUE },
  16. { IDS_INI_LANG5, LANG_BELARUSIAN },
  17. { IDS_INI_LANG6, LANG_BULGARIAN },
  18. { IDS_INI_LANG7, LANG_CATALAN },
  19. { IDS_INI_LANG8, LANG_CHINESE },
  20. { IDS_INI_LANG9, LANG_CROATIAN },
  21. { IDS_INI_LANG10, LANG_CZECH },
  22. { IDS_INI_LANG11, LANG_DANISH },
  23. { IDS_INI_LANG12, LANG_DUTCH },
  24. { IDS_INI_LANG13, LANG_ENGLISH },
  25. { IDS_INI_LANG14, LANG_ESTONIAN },
  26. { IDS_INI_LANG15, LANG_FAEROESE },
  27. { IDS_INI_LANG16, LANG_FARSI },
  28. { IDS_INI_LANG17, LANG_FINNISH },
  29. { IDS_INI_LANG18, LANG_FRENCH },
  30. { IDS_INI_LANG19, LANG_GERMAN },
  31. { IDS_INI_LANG20, LANG_GREEK },
  32. { IDS_INI_LANG21, LANG_HEBREW },
  33. { IDS_INI_LANG22, LANG_HUNGARIAN },
  34. { IDS_INI_LANG23, LANG_ICELANDIC },
  35. { IDS_INI_LANG24, LANG_INDONESIAN },
  36. { IDS_INI_LANG25, LANG_ITALIAN },
  37. { IDS_INI_LANG26, LANG_JAPANESE },
  38. { IDS_INI_LANG27, LANG_KOREAN },
  39. { IDS_INI_LANG28, LANG_LATVIAN },
  40. { IDS_INI_LANG29, LANG_LITHUANIAN },
  41. { IDS_INI_LANG30, LANG_MALAY },
  42. { IDS_INI_LANG31, LANG_NORWEGIAN },
  43. { IDS_INI_LANG32, LANG_POLISH },
  44. { IDS_INI_LANG33, LANG_PORTUGUESE },
  45. { IDS_INI_LANG34, LANG_ROMANIAN },
  46. { IDS_INI_LANG35, LANG_RUSSIAN },
  47. { IDS_INI_LANG36, LANG_SERBIAN },
  48. { IDS_INI_LANG37, LANG_SLOVAK },
  49. { IDS_INI_LANG38, LANG_SLOVENIAN },
  50. { IDS_INI_LANG39, LANG_SPANISH },
  51. { IDS_INI_LANG40, LANG_SWAHILI },
  52. { IDS_INI_LANG41, LANG_SWEDISH },
  53. { IDS_INI_LANG42, LANG_THAI },
  54. { IDS_INI_LANG43, LANG_TURKISH },
  55. { IDS_INI_LANG44, LANG_UKRAINIAN },
  56. };
  57. m_LL = LL;
  58. m_LLlength = sizeof(LL)/sizeof(LL[0]);
  59. };
  60. LPTSTR MSLangID::GetLangFromLangID(WORD langID){
  61. if (langID == LANG_NEUTRAL) {
  62. langID = (WORD)PRIMARYLANGID(::GetUserDefaultLangID());
  63. }
  64. LCID lcid = MAKELCID(MAKELANGID(langID, SUBLANG_DEFAULT), SORT_DEFAULT);
  65. // Try to get it from the system first
  66. for(int i = 0; i < m_LLlength; i++) {
  67. if(m_LL[i].LangID == langID)
  68. return LoadStringFromRes(m_LL[i].ResourceID);
  69. }
  70. return NULL;
  71. }/* end of function GetLangFromLangID */