It seems there is no particularly nice way to do this - which sucks, presumably that's a result of a lack of code re-use in other places. [ taken from the Debian patch ] Index: xmlhelp/source/cxxhelp/provider/urlparameter.cxx =================================================================== RCS file: /cvs/util/xmlhelp/source/cxxhelp/provider/urlparameter.cxx,v retrieving revision 1.25 diff -u -p -u -r1.25 urlparameter.cxx --- xmlhelp/source/cxxhelp/provider/urlparameter.cxx 31 Oct 2001 13:08:14 -0000 1.25 +++ xmlhelp/source/cxxhelp/provider/urlparameter.cxx 17 Jan 2003 16:25:16 -0000 @@ -266,12 +266,32 @@ rtl::OUString URLParameter::get_title() return m_aTitle; } - + rtl::OUString URLParameter::get_language() { if( m_aLanguage.getLength() == 0 ) return m_aDefaultLanguage; + + // Check that we have the necessary files. The rationale is if + // help//err.html exists then, we have localized help + // data, possibly not installed. Otherwise, we won't have + // localized help and we try to fallback to English. + rtl::OUString fileURL = + m_pDatabases->getInstallPathAsURL() + + m_pDatabases->lang( m_aLanguage ) + + rtl::OUString::createFromAscii( "/err.html" ); + + osl::DirectoryItem aDirItem; + osl::File aFile( fileURL ); + osl::FileStatus aStatus( FileStatusMask_FileSize ); + + if( osl::FileBase::E_None != osl::DirectoryItem::get( fileURL,aDirItem ) || + osl::FileBase::E_None != aFile.open( OpenFlag_Read ) || + osl::FileBase::E_None != aDirItem.getFileStatus( aStatus ) ) + { + m_aLanguage = rtl::OUString::createFromAscii( "en-US" ); + } return m_aLanguage; } Index: xmlhelp/source/treeview/tvread.cxx =================================================================== RCS file: /cvs/util/xmlhelp/source/treeview/tvread.cxx,v retrieving revision 1.13 diff -u -p -u -r1.13 tvread.cxx --- xmlhelp/source/treeview/tvread.cxx 8 Nov 2001 16:42:46 -0000 1.13 +++ xmlhelp/source/treeview/tvread.cxx 17 Jan 2003 16:25:16 -0000 @@ -704,7 +704,27 @@ ConfigData TVChildTarget::init( const Re aDirItem ) ) ret = locale.copy( 0,idx ); - url = url + ret; + rtl::OUString test_url = url + ret; + { + // Check that we have the necessary files. The rationale is if + // help//err.html exists then, we have localized help + // data, possibly not installed. Otherwise, we won't have + // localized help and we try to fallback to English. + rtl::OUString errfileURL = test_url + rtl::OUString::createFromAscii( "/err.html" ); + + osl::DirectoryItem aDirItem; + osl::File aFile( errfileURL ); + osl::FileStatus aStatus( FileStatusMask_FileSize ); + + if( osl::FileBase::E_None != osl::DirectoryItem::get( errfileURL,aDirItem ) || + osl::FileBase::E_None != aFile.open( OpenFlag_Read ) || + osl::FileBase::E_None != aDirItem.getFileStatus( aStatus ) ) + { + locale = rtl::OUString::createFromAscii( "en-US" ); + test_url = url + locale.copy( 0, 2 ); + } + } + url = test_url; // first of all, try do determine whether there are any *.tree files present