[Libreoffice-commits] core.git: include/svtools lingucomponent/source

Caolán McNamara caolanm at redhat.com
Wed Oct 25 09:09:37 UTC 2017


 include/svtools/strings.hrc                           |    4 ++++
 lingucomponent/source/hyphenator/hyphen/hyphenimp.cxx |    7 +++++--
 lingucomponent/source/spellcheck/spell/sspellimp.cxx  |    7 +++++--
 lingucomponent/source/thesaurus/libnth/nthesimp.cxx   |    8 ++++++--
 4 files changed, 20 insertions(+), 6 deletions(-)

New commits:
commit 57f649dc9a72e043901582a6e3da916da18ca4ed
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Oct 23 13:27:47 2017 +0100

    Related: tdf#80713 allow translation of linguistic service display names
    
    Change-Id: I23309dde1520e20e66d72fe9780454632d5f75b6
    Reviewed-on: https://gerrit.libreoffice.org/43718
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/include/svtools/strings.hrc b/include/svtools/strings.hrc
index 779abaf7509c..19a08ce498f8 100644
--- a/include/svtools/strings.hrc
+++ b/include/svtools/strings.hrc
@@ -352,6 +352,10 @@
 #define STR_DESCRIPTION_OO_WRITER_TEMPLATE      NC_("STR_DESCRIPTION_OO_WRITER_TEMPLATE", "OpenDocument Text Template")
 #define STR_DESCRIPTION_EXTENSION               NC_("STR_DESCRIPTION_EXTENSION", "%PRODUCTNAME Extension")
 
+#define STR_DESCRIPTION_HUNSPELL                NC_("STR_DESCRIPTION_HUNSPELL", "Hunspell SpellChecker")
+#define STR_DESCRIPTION_LIBHYPHEN               NC_("STR_DESCRIPTION_LIBHYPHEN", "Libhyphen Hyphenator")
+#define STR_DESCRIPTION_MYTHES                  NC_("STR_DESCRIPTION_MYTHES", "Mythes Thesaurus")
+
 #endif
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/lingucomponent/source/hyphenator/hyphen/hyphenimp.cxx b/lingucomponent/source/hyphenator/hyphen/hyphenimp.cxx
index 9b6e41a423c2..5503333c18ce 100644
--- a/lingucomponent/source/hyphenator/hyphen/hyphenimp.cxx
+++ b/lingucomponent/source/hyphenator/hyphen/hyphenimp.cxx
@@ -36,9 +36,11 @@
 
 #include <linguistic/lngprops.hxx>
 #include <linguistic/misc.hxx>
+#include <svtools/strings.hrc>
 #include <unotools/pathoptions.hxx>
 #include <unotools/useroptions.hxx>
 #include <unotools/lingucfg.hxx>
+#include <unotools/resmgr.hxx>
 #include <osl/file.hxx>
 
 #include <stdio.h>
@@ -745,9 +747,10 @@ sal_Bool SAL_CALL Hyphenator::removeLinguServiceEventListener(
     return bRes;
 }
 
-OUString SAL_CALL Hyphenator::getServiceDisplayName( const Locale& /*rLocale*/ )
+OUString SAL_CALL Hyphenator::getServiceDisplayName(const Locale& rLocale)
 {
-    return OUString( "Libhyphen Hyphenator" );
+    std::locale loc(Translate::Create("svt", LanguageTag(rLocale)));
+    return Translate::get(STR_DESCRIPTION_LIBHYPHEN, loc);
 }
 
 void SAL_CALL Hyphenator::initialize( const Sequence< Any >& rArguments )
diff --git a/lingucomponent/source/spellcheck/spell/sspellimp.cxx b/lingucomponent/source/spellcheck/spell/sspellimp.cxx
index 0f363d7d35ad..a4b2a7c197f2 100644
--- a/lingucomponent/source/spellcheck/spell/sspellimp.cxx
+++ b/lingucomponent/source/spellcheck/spell/sspellimp.cxx
@@ -35,8 +35,10 @@
 #include <linguistic/lngprops.hxx>
 #include <linguistic/spelldta.hxx>
 #include <i18nlangtag/languagetag.hxx>
+#include <svtools/strings.hrc>
 #include <unotools/pathoptions.hxx>
 #include <unotools/lingucfg.hxx>
+#include <unotools/resmgr.hxx>
 #include <unotools/useroptions.hxx>
 #include <osl/file.hxx>
 #include <rtl/ustrbuf.hxx>
@@ -579,9 +581,10 @@ sal_Bool SAL_CALL SpellChecker::removeLinguServiceEventListener(
     return bRes;
 }
 
-OUString SAL_CALL SpellChecker::getServiceDisplayName( const Locale& /*rLocale*/ )
+OUString SAL_CALL SpellChecker::getServiceDisplayName(const Locale& rLocale)
 {
-    return OUString( "Hunspell SpellChecker" );
+    std::locale loc(Translate::Create("svt", LanguageTag(rLocale)));
+    return Translate::get(STR_DESCRIPTION_HUNSPELL, loc);
 }
 
 void SAL_CALL SpellChecker::initialize( const Sequence< Any >& rArguments )
diff --git a/lingucomponent/source/thesaurus/libnth/nthesimp.cxx b/lingucomponent/source/thesaurus/libnth/nthesimp.cxx
index 9c008ef4ad9d..d0bdc0b46a7b 100644
--- a/lingucomponent/source/thesaurus/libnth/nthesimp.cxx
+++ b/lingucomponent/source/thesaurus/libnth/nthesimp.cxx
@@ -30,11 +30,14 @@
 #include <osl/mutex.hxx>
 #include <unotools/pathoptions.hxx>
 #include <unotools/lingucfg.hxx>
+#include <unotools/resmgr.hxx>
 
 #include <rtl/string.hxx>
 #include <rtl/ustrbuf.hxx>
 #include <rtl/textenc.h>
 
+#include <svtools/strings.hrc>
+
 #include "nthesimp.hxx"
 #include <linguistic/misc.hxx>
 #include <linguistic/lngprops.hxx>
@@ -517,9 +520,10 @@ Reference< XInterface > SAL_CALL Thesaurus_CreateInstance(
     return xService;
 }
 
-OUString SAL_CALL Thesaurus::getServiceDisplayName( const Locale& /*rLocale*/ )
+OUString SAL_CALL Thesaurus::getServiceDisplayName(const Locale& rLocale)
 {
-    return OUString( "Mythes Thesaurus" );
+    std::locale loc(Translate::Create("svt", LanguageTag(rLocale)));
+    return Translate::get(STR_DESCRIPTION_MYTHES, loc);
 }
 
 void SAL_CALL Thesaurus::initialize( const Sequence< Any >& rArguments )


More information about the Libreoffice-commits mailing list