[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - l10ntools/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Wed Nov 21 12:38:47 UTC 2018


 l10ntools/source/po.cxx |   11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

New commits:
commit d340c6ab33e8513c2c165b56039f43fe34dd0711
Author:     Andras Timar <andras.timar at collabora.com>
AuthorDate: Sun Sep 30 12:53:48 2018 +0200
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Wed Nov 21 13:38:23 2018 +0100

    pocheck: do not change msgctxt when po is regenerated
    
    Change-Id: I220fce194813f783c807c23eeffd2421cadd7636
    Reviewed-on: https://gerrit.libreoffice.org/61163
    Tested-by: Jenkins
    Reviewed-by: Andras Timar <andras.timar at collabora.com>
    (cherry picked from commit 8d4e12a4153868c9d98937d49c4ac6064013a8dd)
    Reviewed-on: https://gerrit.libreoffice.org/63596
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/l10ntools/source/po.cxx b/l10ntools/source/po.cxx
index 45c775d7c456..f316df1bed31 100644
--- a/l10ntools/source/po.cxx
+++ b/l10ntools/source/po.cxx
@@ -140,7 +140,7 @@ void GenPoEntry::writeToFile(std::ofstream& rOFStream) const
         rOFStream << "#, c-format" << std::endl;
     if ( !m_sMsgCtxt.isEmpty() )
         rOFStream << "msgctxt "
-                  << lcl_GenMsgString(m_sReference+"\n"+m_sMsgCtxt)
+                  << lcl_GenMsgString(m_sMsgCtxt)
                   << std::endl;
     rOFStream << "msgid "
               << lcl_GenMsgString(m_sMsgId) << std::endl;
@@ -199,10 +199,7 @@ void GenPoEntry::readFromFile(std::ifstream& rIFStream)
         }
         else if (sLine.startsWith("\"") && pLastMsg)
         {
-            if (pLastMsg != &m_sMsgCtxt || sLine != "\"" + m_sReference + "\\n\"")
-            {
-                *pLastMsg += lcl_GenNormString(sLine);
-            }
+            *pLastMsg += lcl_GenNormString(sLine);
         }
         else
             break;
@@ -233,9 +230,11 @@ PoEntry::PoEntry(
         throw WRONGHELPTEXT;
 
     m_pGenPo.reset( new GenPoEntry() );
-    m_pGenPo->setReference(rSourceFile.copy(rSourceFile.lastIndexOf('/')+1));
+    OString sReference = rSourceFile.copy(rSourceFile.lastIndexOf('/')+1);
+    m_pGenPo->setReference(sReference);
 
     OString sMsgCtxt =
+        sReference + "\n" +
         rGroupId + "\n" +
         (rLocalId.isEmpty() ? OString() : rLocalId + "\n") +
         rResType;


More information about the Libreoffice-commits mailing list