summaryrefslogtreecommitdiff
path: root/framework/inc
diff options
context:
space:
mode:
authorSzymon Kłos <szymon.klos@collabora.com>2020-09-03 21:07:22 +0200
committerSzymon Kłos <szymon.klos@collabora.com>2020-09-18 13:30:37 +0200
commit8de58b6fd63302544affb90df347323b82b7d259 (patch)
treeeb4e081d34731c459d15a98c49ea4b0e419a4957 /framework/inc
parent10aac52bafc8a0430d1da3fe8f45832c64d6bf34 (diff)
lok: make labels and tooltips translated for commands
In the online we can have multiple sessions with different languages so load cached translations only if match current language Change-Id: I6fcf23f1c340c0c0daffa8862f0b74e4e458c1fc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102016 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Szymon Kłos <szymon.klos@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102960 Tested-by: Jenkins Tested-by: Szymon Kłos <szymon.klos@collabora.com>
Diffstat (limited to 'framework/inc')
-rw-r--r--framework/inc/uielement/uicommanddescription.hxx7
1 files changed, 5 insertions, 2 deletions
diff --git a/framework/inc/uielement/uicommanddescription.hxx b/framework/inc/uielement/uicommanddescription.hxx
index 6886224ceb00..146b4f42db3a 100644
--- a/framework/inc/uielement/uicommanddescription.hxx
+++ b/framework/inc/uielement/uicommanddescription.hxx
@@ -20,6 +20,7 @@
#pragma once
#include <unordered_map>
+#include <map>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/container/XNameAccess.hpp>
#include <com/sun/star/frame/XModuleManager2.hpp>
@@ -29,6 +30,7 @@
#include <cppuhelper/compbase.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <rtl/ustring.hxx>
+#include <i18nlangtag/languagetag.hxx>
namespace framework
{
@@ -80,12 +82,13 @@ public:
protected:
UICommandDescription( const css::uno::Reference< css::uno::XComponentContext>& rxContext, bool );
void impl_fillElements(const char* _pName);
+ void ensureGenericUICommandsForLanguage(const LanguageTag& rLanguage);
OUString m_aPrivateResourceURL;
css::uno::Reference< css::uno::XComponentContext > m_xContext;
ModuleToCommandFileMap m_aModuleToCommandFileMap;
- UICommandsHashMap m_aUICommandsHashMap;
- css::uno::Reference< css::container::XNameAccess > m_xGenericUICommands;
+ std::map<LanguageTag, UICommandsHashMap> m_aUICommandsHashMap;
+ std::map<LanguageTag, css::uno::Reference< css::container::XNameAccess > > m_xGenericUICommands;
css::uno::Reference< css::frame::XModuleManager2 > m_xModuleManager;
};