Index: abi/src/af/util/xp/ut_Language.cpp =================================================================== RCS file: /cvsroot/abi/src/af/util/xp/ut_Language.cpp,v retrieving revision 1.48.2.1 diff -u -r1.48.2.1 ut_Language.cpp --- abi/src/af/util/xp/ut_Language.cpp 2 Mar 2005 20:39:20 -0000 1.48.2.1 +++ abi/src/af/util/xp/ut_Language.cpp 23 Mar 2005 00:37:09 -0000 @@ -202,30 +202,38 @@ #endif } +/*! + Set the language name attribut in the language table. It takes the localized + names from the available stringset. This function is supplied to set the names + after the stringset is known to the application. +*/ +void UT_Language_updateLanguageNames() +{ + const XAP_StringSet * pSS = XAP_App::getApp()->getStringSet(); + UT_return_if_fail(pSS); + + for(UT_uint32 i = 0; i < NrElements(s_Table); i++) + { + s_Table[i].m_szLangName = const_cast(pSS->getValue(s_Table[i].m_nID)); + } -bool UT_Language::s_Init = true; + qsort(&s_Table[0], NrElements(s_Table), sizeof(UT_LangRecord), s_compareQ); +} +bool UT_Language::s_Init = true; + /*! The constructor looks up the translations for the language code and sorts the table alphabetically by the language name */ UT_Language::UT_Language() { - if(s_Init) //only do this once - { - const XAP_StringSet * pSS = XAP_App::getApp()->getStringSet(); - - UT_return_if_fail(pSS); - - for(UT_uint32 i = 0; i < NrElements(s_Table); i++) - { - s_Table[i].m_szLangName = const_cast(pSS->getValue(s_Table[i].m_nID)); - } - - qsort(&s_Table[0], NrElements(s_Table), sizeof(UT_LangRecord), s_compareQ); - s_Init = false; - } + if(s_Init) // do this once here + { + UT_Language_updateLanguageNames(); + s_Init = false; + } } UT_uint32 UT_Language::getCount() Index: abi/src/af/util/xp/ut_Language.h =================================================================== RCS file: /cvsroot/abi/src/af/util/xp/ut_Language.h,v retrieving revision 1.11 diff -u -r1.11 ut_Language.h --- abi/src/af/util/xp/ut_Language.h 5 Dec 2003 14:14:42 -0000 1.11 +++ abi/src/af/util/xp/ut_Language.h 23 Mar 2005 00:37:09 -0000 @@ -65,4 +65,5 @@ static bool s_Init; }; +ABI_EXPORT void UT_Language_updateLanguageNames(); #endif Index: abi/src/wp/ap/win/ap_Win32App.cpp =================================================================== RCS file: /cvsroot/abi/src/wp/ap/win/ap_Win32App.cpp,v retrieving revision 1.154 diff -u -r1.154 ap_Win32App.cpp --- abi/src/wp/ap/win/ap_Win32App.cpp 1 Jan 2005 13:24:04 -0000 1.154 +++ abi/src/wp/ap/win/ap_Win32App.cpp 23 Mar 2005 00:37:23 -0000 @@ -207,6 +207,7 @@ { pDiskStringSet->setFallbackStringSet(m_pStringSet); m_pStringSet = pDiskStringSet; + UT_Language_updateLanguageNames(); UT_DEBUGMSG(("Using StringSet [%s]\n",szPathname)); } else