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

Caolán McNamara caolanm at redhat.com
Mon Mar 14 15:11:53 UTC 2016


 l10ntools/source/merge.cxx |   17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

New commits:
commit 032cb7ed80a504b4abec479f30c2c03f10e14639
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Mar 14 15:10:44 2016 +0000

    Resolves: tdf#98473 replace || with ‖ to avoid illegal gtk3 action names
    
    Change-Id: Ic5098c439ac94d68f881e06378938fab29e8bb3d

diff --git a/l10ntools/source/merge.cxx b/l10ntools/source/merge.cxx
index 3922e89..7789e3b 100644
--- a/l10ntools/source/merge.cxx
+++ b/l10ntools/source/merge.cxx
@@ -121,13 +121,22 @@ bool MergeEntrys::GetText( OString &rReturn,
     return bReturn;
 }
 
+namespace
+{
+    OString GetDoubleBars()
+    {
+        //DOUBLE VERTICAL LINE instead of || because the translations make their
+        //way into action_names under gtk3 where || is illegal
+        return OUStringToOString(OUString(static_cast<sal_Unicode>(0x2016)), RTL_TEXTENCODING_UTF8);
+    }
+}
 
 OString MergeEntrys::GetQTZText(const ResData& rResData, const OString& rOrigText)
 {
     const OString sFilename = rResData.sFilename.copy(rResData.sFilename.lastIndexOf('/')+1);
     const OString sKey =
         PoEntry::genKeyId(sFilename + rResData.sGId + rResData.sId + rResData.sResTyp + rOrigText);
-    return sKey + "||" + rOrigText;
+    return sKey + GetDoubleBars() + rOrigText;
 }
 
 
@@ -411,9 +420,9 @@ void MergeDataFile::InsertEntry(
         const OString sTemp = rInFilename + rGID + rLID + rTYP;
         pMergeEntrys->InsertEntry(
             nLANG,
-            rTEXT.isEmpty()? rTEXT : PoEntry::genKeyId(sTemp + rTEXT) + "||" + rTEXT,
-            rQHTEXT.isEmpty()? rQHTEXT : PoEntry::genKeyId(sTemp + rQHTEXT) + "||" + rQHTEXT,
-            rTITLE.isEmpty()? rTITLE : PoEntry::genKeyId(sTemp + rTITLE) + "||" + rTITLE );
+            rTEXT.isEmpty()? rTEXT : PoEntry::genKeyId(sTemp + rTEXT) + GetDoubleBars() + rTEXT,
+            rQHTEXT.isEmpty()? rQHTEXT : PoEntry::genKeyId(sTemp + rQHTEXT) + GetDoubleBars() + rQHTEXT,
+            rTITLE.isEmpty()? rTITLE : PoEntry::genKeyId(sTemp + rTITLE) + GetDoubleBars() + rTITLE );
     }
     else
     {


More information about the Libreoffice-commits mailing list