[Libreoffice-commits] core.git: unotools/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Thu Dec 13 14:18:21 UTC 2018


 unotools/source/i18n/resmgr.cxx |   22 ++++++++++++++++++++--
 1 file changed, 20 insertions(+), 2 deletions(-)

New commits:
commit b75ee1b35c72214d7c0dea98eda87ec9531cb768
Author:     Tor Lillqvist <tml at collabora.com>
AuthorDate: Fri Nov 16 00:54:14 2018 +0200
Commit:     Tor Lillqvist <tml at collabora.com>
CommitDate: Thu Dec 13 15:17:53 2018 +0100

    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 at collabora.com>

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;


More information about the Libreoffice-commits mailing list