diff options
-rw-r--r-- | sc/source/ui/inc/content.hxx | 2 | ||||
-rw-r--r-- | sc/source/ui/navipi/content.cxx | 18 |
2 files changed, 19 insertions, 1 deletions
diff --git a/sc/source/ui/inc/content.hxx b/sc/source/ui/inc/content.hxx index 2e8c6757e202..b57e49eb55f2 100644 --- a/sc/source/ui/inc/content.hxx +++ b/sc/source/ui/inc/content.hxx @@ -55,6 +55,8 @@ class ScContentTree o3tl::enumarray<ScContentId, sal_uInt16> pPosList; // for the sequence + std::unique_ptr<std::locale> m_pResLocaleForLOK; //it needed only in case of LOK + ScDocShell* GetManualOrCurrent(); void InitRoot(ScContentId nType); diff --git a/sc/source/ui/navipi/content.cxx b/sc/source/ui/navipi/content.cxx index af8b64b6fdba..588476d97ed9 100644 --- a/sc/source/ui/navipi/content.cxx +++ b/sc/source/ui/navipi/content.cxx @@ -188,7 +188,23 @@ void ScContentTree::InitRoot( ScContentId nType ) } auto const & aImage = aContentBmps[static_cast<int>(nType) - 1]; - OUString aName(ScResId(SCSTR_CONTENT_ARY[static_cast<int>(nType)])); + + OUString aName; + if(comphelper::LibreOfficeKit::isActive()) + { + //In case of LOK we may have many different ScContentTrees in different languages. + //At creation time, we store what language we use, and then use it later too. + //It does not work in the constructor, that is why it is here. + if (!m_pResLocaleForLOK) + { + m_pResLocaleForLOK = std::make_unique<std::locale>(SC_MOD()->GetResLocale()); + } + aName = Translate::get(SCSTR_CONTENT_ARY[static_cast<int>(nType)], *m_pResLocaleForLOK); + } + else + { + aName = ScResId(SCSTR_CONTENT_ARY[static_cast<int>(nType)]); + } // back to the correct position: sal_uInt16 nPos = nRootType != ScContentId::ROOT ? 0 : pPosList[nType]-1; m_aRootNodes[nType] = m_xTreeView->make_iterator(); |