summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@collabora.com>2018-04-26 21:25:43 +0100
committerAndras Timar <andras.timar@collabora.com>2018-08-20 11:57:38 +0200
commitdcb92409e97bb084d8363885c2dcd2807922ed33 (patch)
tree578754a21a635b7a5dbb77cf5ad0b4bce3e9e0c7
parent99ce39d751a85522ba2a706a76cbd6cb08e144ab (diff)
Localize chart strings properly.
Change-Id: I982c95a50c1b4cd9f03f45b0203e06aca3711969 Reviewed-on: https://gerrit.libreoffice.org/53544 Reviewed-by: Aron Budea <aron.budea@collabora.com> Tested-by: Aron Budea <aron.budea@collabora.com> (cherry picked from commit 23109bc47daf037b76b3188c3ac3030873cb8529)
-rw-r--r--chart2/source/tools/ResourceManager.cxx10
1 files changed, 6 insertions, 4 deletions
diff --git a/chart2/source/tools/ResourceManager.cxx b/chart2/source/tools/ResourceManager.cxx
index 3f3fb615697a..ee842e701d48 100644
--- a/chart2/source/tools/ResourceManager.cxx
+++ b/chart2/source/tools/ResourceManager.cxx
@@ -19,6 +19,7 @@
#include "ResourceManager.hxx"
+#include <vcl/svapp.hxx>
#include <tools/resmgr.hxx>
namespace chart
@@ -27,11 +28,12 @@ namespace chart
ResMgr & ResourceManager::getResourceManager()
{
// not threadsafe
- static ResMgr * pResourceManager = nullptr;
- if( ! pResourceManager )
- pResourceManager = ResMgr::CreateResMgr("chartcontroller");
+ static std::unique_ptr<ResMgr> pResourceManager;
+ const LanguageTag& rLocale = Application::GetSettings().GetUILanguageTag();
+ if( ! pResourceManager || pResourceManager->GetLocale() != rLocale )
+ pResourceManager.reset( ResMgr::CreateResMgr("chartcontroller", rLocale) );
OSL_ASSERT( pResourceManager );
- return *pResourceManager;
+ return *pResourceManager.get();
}
} // namespace chart