diff -u -r1.68 sfxhelp.cxx
--- sfx2/source/appl/sfxhelp.cxx	7 Feb 2006 10:29:33 -0000	1.68
+++ sfx2/source/appl/sfxhelp.cxx	28 Mar 2006 13:12:14 -0000
@@ -109,6 +112,11 @@
 #include <svtools/pathoptions.hxx>
 #include <rtl/ustring.hxx>
 #include <osl/process.h>
+#include <osl/file.hxx>
+#ifndef _UTL_BOOTSTRAP_HXX
+#include <unotools/bootstrap.hxx>
+#endif
+
 #include <rtl/uri.hxx>
 #include <vcl/msgbox.hxx>
 #include <svtools/ehdl.hxx>
@@ -165,16 +173,53 @@
 
 #define STARTERLIST 0
 
+rtl::OUString HelpLocaleString()
+{
+	static rtl::OUString aLocaleStr;
+	if (!aLocaleStr.getLength())
+	{
+		// detect installed locale
+		Any aLocale =
+			::utl::ConfigManager::GetConfigManager()->GetDirectConfigProperty( 
+			   ::utl::ConfigManager::LOCALE );
+		bool bOk = (aLocale >>= aLocaleStr);
+		if ( bOk )
+		{
+			rtl::OUString aBaseInstallPath;
+			utl::Bootstrap::PathStatus aBaseLocateResult =
+				utl::Bootstrap::locateBaseInstallation(aBaseInstallPath);
+			static const char *szHelpPath = "/help/";
+
+			rtl::OUString sHelpPath = aBaseInstallPath +
+				rtl::OUString::createFromAscii(szHelpPath) + aLocaleStr;
+			osl::DirectoryItem aDirItem;
+
+			if (!osl::DirectoryItem::get(sHelpPath, aDirItem) == osl::FileBase::E_None)
+			{
+				bOk = false;
+				String sLang(aLocaleStr);
+				xub_StrLen nSepPos = sLang.Search( '-' );     
+				if (nSepPos != STRING_NOTFOUND)
+				{
+					bOk = true;
+        			sLang = sLang.Copy( 0, nSepPos );
+					sHelpPath = aBaseInstallPath +
+						rtl::OUString::createFromAscii(szHelpPath) + sLang;
+					if (!osl::DirectoryItem::get(sHelpPath, aDirItem) == osl::FileBase::E_None)
+						bOk = false;
+				}
+			}
+		}
+		if (!bOk)
+			aLocaleStr = rtl::OUString( DEFINE_CONST_UNICODE("en") );
+	}
+	return aLocaleStr;
+}
+
+
 void AppendConfigToken_Impl( String& rURL, sal_Bool bQuestionMark )
 {
-	// this completes a help url with the system parameters "Language" and "System"
-	// detect installed locale
-	Any aLocale =
-		::utl::ConfigManager::GetConfigManager()->GetDirectConfigProperty( ::utl::ConfigManager::LOCALE );
-    ::rtl::OUString aLocaleStr;
-	if ( !( aLocale >>= aLocaleStr ) )
-		// fallback is english
-		aLocaleStr = ::rtl::OUString( DEFINE_CONST_UNICODE("en") );
+	::rtl::OUString aLocaleStr(HelpLocaleString());
 
 	// query part exists?
 	if ( bQuestionMark )
@@ -189,6 +234,7 @@
 	rURL += String( aLocaleStr );
 	rURL += DEFINE_CONST_UNICODE("&System=");
 	rURL += SvtHelpOptions().GetSystem();
+
 }
 
 // -----------------------------------------------------------------------
@@ -426,11 +472,8 @@
 
 	pImp = new SfxHelp_Impl( bIsDebug );
 
-    Any aLocale =
-		::utl::ConfigManager::GetConfigManager()->GetDirectConfigProperty( ::utl::ConfigManager::LOCALE );
-    ::rtl::OUString aLocaleStr;
-    if ( !( aLocale >>= aLocaleStr ) )
-        aLocaleStr = ::rtl::OUString( DEFINE_CONST_UNICODE("en") );
+    ::rtl::OUString aLocaleStr = HelpLocaleString();
+
     sal_Int32 nSepPos = aLocaleStr.indexOf( '_' );
     if ( nSepPos != -1 )
     {
--- xmlhelp/source/treeview/tvread.cxx	23 Mar 2005 13:04:52 -0000	1.16
+++ xmlhelp/source/treeview/tvread.cxx	24 Oct 2005 11:15:48 -0000
@@ -701,7 +701,11 @@ ConfigData TVChildTarget::init( const Re
 			 osl::FileBase::E_None == osl::DirectoryItem::get( url + locale.copy( 0,idx ),
 															   aDirItem ) )
 		ret = locale.copy( 0,idx );
-	
+    else
+        {
+        locale = rtl::OUString::createFromAscii( "en-US" );
+        ret = rtl::OUString::createFromAscii("en");
+        }
 	url = url + ret;
 	
 	// first of all, try do determine whether there are any *.tree files present
