diff options
author | Ztamas <zolnaitamas2000g@gmail.com> | 2012-11-18 12:07:58 +0100 |
---|---|---|
committer | Ztamas <zolnaitamas2000g@gmail.com> | 2012-11-18 12:07:58 +0100 |
commit | 302a099e5264742204b625f1cce949892d8a84f9 (patch) | |
tree | 906738af160d90e063d05d9370e164d96bfaf08c /l10ntools | |
parent | fea5e609ba800118cdb5d84c8bd78d00e86e003e (diff) |
Write source file into po entries' msgctxt
So (msgctxt, msgid) pair is unique in one po file
Change-Id: I64635dd7a6352300ed5fb6949a1b78c2a070c660
Diffstat (limited to 'l10ntools')
-rw-r--r-- | l10ntools/source/po.cxx | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/l10ntools/source/po.cxx b/l10ntools/source/po.cxx index 18c0ef1042d4..df9efe31bc64 100644 --- a/l10ntools/source/po.cxx +++ b/l10ntools/source/po.cxx @@ -198,7 +198,8 @@ void GenPoEntry::writeToFile(std::ofstream& rOFStream) const rOFStream << "#, fuzzy" << std::endl; if ( !m_sMsgCtxt.isEmpty() ) rOFStream << "msgctxt " - << lcl_GenMsgString(m_sMsgCtxt).getStr() << std::endl; + << lcl_GenMsgString(m_sReference+"\n"+m_sMsgCtxt).getStr() + << std::endl; rOFStream << "msgid " << lcl_GenMsgString(m_sMsgId).getStr() << std::endl; rOFStream << "msgstr " @@ -251,7 +252,8 @@ void GenPoEntry::readFromFile(std::ifstream& rIFStream) m_sMsgStr = lcl_GenNormString(sLine.copy(7)); pLastMsg = &m_sMsgStr; } - else if (sLine.startsWith("\"") && pLastMsg) + else if (sLine.startsWith("\"") && pLastMsg && + (pLastMsg != &m_sMsgCtxt || sLine != "\"" + m_sReference + "\"") ) { *pLastMsg += lcl_GenNormString(sLine); } |