diff options
author | Jan Holesovsky <kendy@collabora.com> | 2017-12-13 19:17:48 +0100 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2017-12-14 11:31:50 +0100 |
commit | eaccbef4f4f9509152efb7613f2ff48a2d6e7a5e (patch) | |
tree | 458e6f8eebde83eb7e9667a3091e5dd1305eb3b2 /cui | |
parent | 689176e9424e617a64edd5e233b750b2269a7275 (diff) |
lokdialog: Allow switching language of some of the ResMgr's.
This way, it is possible to have all the strings translated in dialogs even
when different users use different languages. [It was already possible
to have different languages previously, but not everything in the dialog has
switched - like the buttons at the bottom of the dialogs etc.]
Change-Id: I29a5ae6d31a370eec60397884200b684ec1bf5b9
Reviewed-on: https://gerrit.libreoffice.org/46417
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
Diffstat (limited to 'cui')
-rw-r--r-- | cui/source/factory/cuiresmgr.cxx | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/cui/source/factory/cuiresmgr.cxx b/cui/source/factory/cuiresmgr.cxx index e872f9dd9836..e61da43b6710 100644 --- a/cui/source/factory/cuiresmgr.cxx +++ b/cui/source/factory/cuiresmgr.cxx @@ -25,14 +25,16 @@ // struct DialogsResMgr -------------------------------------------------- ResMgr* CuiResMgr::GetResMgr() { - static ResMgr* pResMgr=nullptr; + static std::unique_ptr<ResMgr> pResMgr; - if ( !pResMgr ) + const LanguageTag& rLocale = Application::GetSettings().GetUILanguageTag(); + + if (!pResMgr || pResMgr->GetLocale() != rLocale) { - pResMgr = ResMgr::CreateResMgr("cui", Application::GetSettings().GetUILanguageTag()); + pResMgr.reset(ResMgr::CreateResMgr("cui", rLocale)); } - return pResMgr; + return pResMgr.get(); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |