diff options
author | Tor Lillqvist <tml@collabora.com> | 2018-11-16 00:54:14 +0200 |
---|---|---|
committer | Tor Lillqvist <tml@collabora.com> | 2018-12-13 15:17:53 +0100 |
commit | b75ee1b35c72214d7c0dea98eda87ec9531cb768 (patch) | |
tree | 1567d78988ab2229065293174436552ba863a297 /unotools | |
parent | bbb130f8228797121d57a5e2e36ae95256bdce33 (diff) |
Swiss Standard German: replace 'ß' in German translation with 'ss'
Although there as such is nothing LibreOfficeKit-specific here, do it
conditionally only when being used from a LibreOfficeKit client to
avoid bike-shedding.
Change-Id: I2af12394648ddad352f24c71581be0f9bf5e3d70
Reviewed-on: https://gerrit.libreoffice.org/63447
Tested-by: Jenkins
Reviewed-by: Tor Lillqvist <tml@collabora.com>
Diffstat (limited to 'unotools')
-rw-r--r-- | unotools/source/i18n/resmgr.cxx | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/unotools/source/i18n/resmgr.cxx b/unotools/source/i18n/resmgr.cxx index be66f9445816..d2a59c727cf7 100644 --- a/unotools/source/i18n/resmgr.cxx +++ b/unotools/source/i18n/resmgr.cxx @@ -40,6 +40,7 @@ # include <libintl.h> #endif +#include <comphelper/lok.hxx> #include <tools/debug.hxx> #include <tools/stream.hxx> #include <unotools/resmgr.hxx> @@ -218,7 +219,16 @@ namespace Translate //otherwise translate it const std::string ret = boost::locale::pgettext(sContext.getStr(), pId, loc); - return ExpandVariables(createFromUtf8(ret.data(), ret.size())); + OUString result(ExpandVariables(createFromUtf8(ret.data(), ret.size()))); + + if (comphelper::LibreOfficeKit::isActive()) + { + // If it is de-CH, change sharp s to double s. + if (std::use_facet<boost::locale::info>(loc).country() == "CH" && + std::use_facet<boost::locale::info>(loc).language() == "de") + result = result.replaceAll(OUString::fromUtf8("\xC3\x9F"), "ss"); + } + return result; } OUString nget(const char* pContextAndIds, int n, const std::locale &loc) @@ -243,7 +253,15 @@ namespace Translate //otherwise translate it const std::string ret = boost::locale::npgettext(aContextIdId[0].getStr(), aContextIdId[1].getStr(), aContextIdId[2].getStr(), n, loc); - return ExpandVariables(createFromUtf8(ret.data(), ret.size())); + OUString result(ExpandVariables(createFromUtf8(ret.data(), ret.size()))); + + if (comphelper::LibreOfficeKit::isActive()) + { + if (std::use_facet<boost::locale::info>(loc).country() == "CH" && + std::use_facet<boost::locale::info>(loc).language() == "de") + result = result.replaceAll(OUString::fromUtf8("\xC3\x9F"), "ss"); + } + return result; } static ResHookProc pImplResHookProc = nullptr; |