Kaydet (Commit) 57f649dc authored tarafından Caolán McNamara's avatar Caolán McNamara

Related: tdf#80713 allow translation of linguistic service display names

Change-Id: I23309dde1520e20e66d72fe9780454632d5f75b6
Reviewed-on: https://gerrit.libreoffice.org/43718Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 83fd71e0
......@@ -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: */
......@@ -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 )
......
......@@ -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 )
......
......@@ -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 )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment