summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Suo <suokunlong@126.com>2022-10-22 14:15:35 +0800
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-10-23 17:56:22 +0200
commita97bae545d72d8b19f39aa9280c0f284c79d0f6c (patch)
tree5a51ee5dcd54f1e7aa02efc6850fc39d4a2bc782
parent2e87990f4a317ac1958f88fafb85a93b5f85a3ea (diff)
tdf#151697: Use localized string for "Loading" and "Saving" in status bar
Change-Id: I51967950839e7384e8f31178a70bd944d6f9059c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141662 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--filter/Library_xmlfa.mk5
-rw-r--r--filter/inc/strings.hrc12
-rw-r--r--filter/source/xmlfilteradaptor/XmlFilterAdaptor.cxx6
3 files changed, 21 insertions, 2 deletions
diff --git a/filter/Library_xmlfa.mk b/filter/Library_xmlfa.mk
index 35a2dd9ff9b6..e1157cca3059 100644
--- a/filter/Library_xmlfa.mk
+++ b/filter/Library_xmlfa.mk
@@ -25,6 +25,11 @@ $(eval $(call gb_Library_use_external,xmlfa,boost_headers))
$(eval $(call gb_Library_use_sdk_api,xmlfa))
+$(eval $(call gb_Library_set_include,xmlfa,\
+ $$(INCLUDE) \
+ -I$(SRCDIR)/filter/inc \
+))
+
$(eval $(call gb_Library_use_libraries,xmlfa,\
comphelper \
cppuhelper \
diff --git a/filter/inc/strings.hrc b/filter/inc/strings.hrc
index eecfdb33e2d0..a8454956f385 100644
--- a/filter/inc/strings.hrc
+++ b/filter/inc/strings.hrc
@@ -19,6 +19,9 @@
#pragma once
+#include <rtl/ustring.hxx>
+#include <unotools/resmgr.hxx>
+
#define NC_(Context, String) TranslateId(Context, reinterpret_cast<char const *>(u8##String))
#define STR_UNKNOWN_APPLICATION NC_("STR_UNKNOWN_APPLICATION", "Unknown")
@@ -73,4 +76,13 @@
#define STR_ERR_SIGNATURE_FAILED NC_("STR_ERR_SIGNATURE_FAILED", "Signature generation failed")
#define STR_ERR_PDF_EXPORT_ABORTED NC_("STR_ERR_PDF_EXPORT_ABORTED", "PDF export aborted")
+// Progress bar status indicator when importing or exporting
+#define STR_FILTER_DOC_LOADING NC_("STR_FILTER_DOC_LOADING", "Loading: ")
+#define STR_FILTER_DOC_SAVING NC_("STR_FILTER_DOC_SAVING", "Saving: ")
+
+static inline OUString FilterResId(TranslateId aId)
+{
+ return Translate::get(aId, Translate::Create("flt"));
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/filter/source/xmlfilteradaptor/XmlFilterAdaptor.cxx b/filter/source/xmlfilteradaptor/XmlFilterAdaptor.cxx
index 11686e7c919e..525f567b67c0 100644
--- a/filter/source/xmlfilteradaptor/XmlFilterAdaptor.cxx
+++ b/filter/source/xmlfilteradaptor/XmlFilterAdaptor.cxx
@@ -43,6 +43,8 @@
#include <unotools/pathoptions.hxx>
#include <xmloff/xmlimp.hxx>
+#include <strings.hrc>
+
using namespace comphelper;
using namespace com::sun::star::uno;
using namespace com::sun::star::lang;
@@ -67,7 +69,7 @@ bool XmlFilterAdaptor::importImpl( const Sequence< css::beans::PropertyValue >&
utl::MediaDescriptor::PROP_STATUSINDICATOR, Reference< XStatusIndicator >()));
if (xStatusIndicator.is()){
- xStatusIndicator->start( "Loading :", 4);
+ xStatusIndicator->start(FilterResId(STR_FILTER_DOC_LOADING), 4);
}
OUString aBaseURI;
@@ -233,7 +235,7 @@ bool XmlFilterAdaptor::exportImpl( const Sequence< css::beans::PropertyValue >&
utl::MediaDescriptor::PROP_STATUSINDICATOR, Reference< XStatusIndicator >()));
if (xStatusIndicator.is())
- xStatusIndicator->start( "Saving :", 3);
+ xStatusIndicator->start(FilterResId(STR_FILTER_DOC_SAVING), 3);
// Set up converter bridge.
Reference< css::xml::XExportFilter > xConverter(mxContext->getServiceManager()->createInstanceWithContext( udConvertClass, mxContext ), UNO_QUERY);