filter/Library_xmlfa.mk | 5 +++++ filter/inc/strings.hrc | 12 ++++++++++++ filter/source/xmlfilteradaptor/XmlFilterAdaptor.cxx | 6 ++++-- 3 files changed, 21 insertions(+), 2 deletions(-)
New commits: commit a97bae545d72d8b19f39aa9280c0f284c79d0f6c Author: Kevin Suo <suokunl...@126.com> AuthorDate: Sat Oct 22 14:15:35 2022 +0800 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Sun Oct 23 17:56:22 2022 +0200 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.gran...@collabora.co.uk> 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);