Kaydet (Commit) b75ee1b3 authored tarafından Tor Lillqvist's avatar Tor Lillqvist

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: 's avatarTor Lillqvist <tml@collabora.com>
üst bbb130f8
......@@ -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;
......
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