Author: jani
Date: Mon Sep 30 11:57:33 2013
New Revision: 1527521
URL: http://svn.apache.org/r1527521
Log:
error in old xrm extract <title not extracted, corrected
setSourceKey in merge may not create new keys (throw instead)
Modified:
openoffice/branches/l10n40/main/l10ntools/source/gConSrcWrap.cxx
openoffice/branches/l10n40/main/l10ntools/source/gConTreeWrap.cxx
openoffice/branches/l10n40/main/l10ntools/source/gConUlfWrap.cxx
openoffice/branches/l10n40/main/l10ntools/source/gConXcsWrap.cxx
openoffice/branches/l10n40/main/l10ntools/source/gConXcuWrap.cxx
openoffice/branches/l10n40/main/l10ntools/source/gConXhpWrap.cxx
openoffice/branches/l10n40/main/l10ntools/source/gConXrmWrap.cxx
openoffice/branches/l10n40/main/l10ntools/source/gConXrmlex.l
openoffice/branches/l10n40/main/l10ntools/source/gL10nMem.cxx
openoffice/branches/l10n40/main/l10ntools/source/gL10nMem.hxx
openoffice/branches/l10n40/main/l10ntools/source/gLang.hxx
openoffice/branches/l10n40/main/languages/source/templates/readlicense_oo.pot
Modified: openoffice/branches/l10n40/main/l10ntools/source/gConSrcWrap.cxx
URL:
http://svn.apache.org/viewvc/openoffice/branches/l10n40/main/l10ntools/source/gConSrcWrap.cxx?rev=1527521&r1=1527520&r2=1527521&view=diff
==============================================================================
--- openoffice/branches/l10n40/main/l10ntools/source/gConSrcWrap.cxx (original)
+++ openoffice/branches/l10n40/main/l10ntools/source/gConSrcWrap.cxx Mon Sep 30
11:57:33 2013
@@ -212,7 +212,7 @@ void convert_src::setNL(char *syyText, b
sKey += "." + msCmd + "." + msTextName;
if (msValue.size() && msValue != "-")
{
- mcMemory.setSourceKey(miLineNo, msSourceFile, sKey, msValue);
+ mcMemory.setSourceKey(miLineNo, msSourceFile, sKey, msValue,
mbMergeMode);
if (mbMergeMode)
insertLanguagePart(sKey, msTextName);
}
Modified: openoffice/branches/l10n40/main/l10ntools/source/gConTreeWrap.cxx
URL:
http://svn.apache.org/viewvc/openoffice/branches/l10n40/main/l10ntools/source/gConTreeWrap.cxx?rev=1527521&r1=1527520&r2=1527521&view=diff
==============================================================================
--- openoffice/branches/l10n40/main/l10ntools/source/gConTreeWrap.cxx (original)
+++ openoffice/branches/l10n40/main/l10ntools/source/gConTreeWrap.cxx Mon Sep
30 11:57:33 2013
@@ -130,7 +130,7 @@ void convert_tree::setString(char *yytex
case STATE_VAL_TITLE:
std::string sText = copySourceSpecial(yytext, 1);
sText.erase(sText.size()-1);
- mcMemory.setSourceKey(miLineNo, msSourceFile, msId, sText);
+ mcMemory.setSourceKey(miLineNo, msSourceFile, msId, sText,
mbMergeMode);
break;
}
meStateVal = STATE_VAL_NONE;
@@ -152,7 +152,7 @@ void convert_tree::setState(char *yytext
/********************** I M P L E M E N T A T I O N **********************/
void convert_tree::setValue(char *yytext)
{
- mcMemory.setSourceKey(miLineNo, msSourceFile, msId, msCollector);
+ mcMemory.setSourceKey(miLineNo, msSourceFile, msId, msCollector,
mbMergeMode);
copySourceSpecial(yytext, 2);
meStateTag = STATE_TAG_NONE;
Modified: openoffice/branches/l10n40/main/l10ntools/source/gConUlfWrap.cxx
URL:
http://svn.apache.org/viewvc/openoffice/branches/l10n40/main/l10ntools/source/gConUlfWrap.cxx?rev=1527521&r1=1527520&r2=1527521&view=diff
==============================================================================
--- openoffice/branches/l10n40/main/l10ntools/source/gConUlfWrap.cxx (original)
+++ openoffice/branches/l10n40/main/l10ntools/source/gConUlfWrap.cxx Mon Sep 30
11:57:33 2013
@@ -90,6 +90,8 @@ void convert_ulf::setValue(char *syyText
nL = sText.rfind("\"");
sText.erase(nL);
+ mcMemory.setSourceKey(miLineNo, msSourceFile, msKey, sText, mbMergeMode);
+
if (mbMergeMode)
{
// prepare to read all languages
@@ -97,11 +99,8 @@ void convert_ulf::setValue(char *syyText
for (; mcMemory.getMergeLang(sLang, sText);)
{
// Prepare tag
- sText = "\"\n" + sLang + " = \"" + sText;
+ sText = "\n" + sLang + " = \"" + sText + "\"";
writeSourceFile(sText);
}
}
- else
- mcMemory.setSourceKey(miLineNo, msSourceFile, msKey, sText);
-
}
Modified: openoffice/branches/l10n40/main/l10ntools/source/gConXcsWrap.cxx
URL:
http://svn.apache.org/viewvc/openoffice/branches/l10n40/main/l10ntools/source/gConXcsWrap.cxx?rev=1527521&r1=1527520&r2=1527521&view=diff
==============================================================================
--- openoffice/branches/l10n40/main/l10ntools/source/gConXcsWrap.cxx (original)
+++ openoffice/branches/l10n40/main/l10ntools/source/gConXcsWrap.cxx Mon Sep 30
11:57:33 2013
@@ -157,6 +157,6 @@ void convert_xcs::stopCollectData(char *
#endif
}
- mcMemory.setSourceKey(miLineNo, msSourceFile, sKey, sText);
+ mcMemory.setSourceKey(miLineNo, msSourceFile, sKey, sText, mbMergeMode);
mbCollectingData = false;
}
Modified: openoffice/branches/l10n40/main/l10ntools/source/gConXcuWrap.cxx
URL:
http://svn.apache.org/viewvc/openoffice/branches/l10n40/main/l10ntools/source/gConXcuWrap.cxx?rev=1527521&r1=1527520&r2=1527521&view=diff
==============================================================================
--- openoffice/branches/l10n40/main/l10ntools/source/gConXcuWrap.cxx (original)
+++ openoffice/branches/l10n40/main/l10ntools/source/gConXcuWrap.cxx Mon Sep 30
11:57:33 2013
@@ -63,9 +63,6 @@ namespace XcuWrap
/********************** I M P L E M E N T A T I O N **********************/
void convert_xcu::execute()
{
- if (mbMergeMode)
- throw l10nMem::showError("Merge not implemented");
-
XcuWrap::yylex();
}
@@ -163,7 +160,7 @@ void convert_xcu::stopCollectData(char *
// locate key and extract it
for (nL = 0; nL < (int)mcStack.size(); ++nL)
useKey += (useKey.size() ? "." : "" ) + mcStack[nL];
- mcMemory.setSourceKey(miLineNo, msSourceFile, useKey, useText);
+ mcMemory.setSourceKey(miLineNo, msSourceFile, useKey, useText,
mbMergeMode);
}
if (mbMergeMode)
Modified: openoffice/branches/l10n40/main/l10ntools/source/gConXhpWrap.cxx
URL:
http://svn.apache.org/viewvc/openoffice/branches/l10n40/main/l10ntools/source/gConXhpWrap.cxx?rev=1527521&r1=1527520&r2=1527521&view=diff
==============================================================================
--- openoffice/branches/l10n40/main/l10ntools/source/gConXhpWrap.cxx (original)
+++ openoffice/branches/l10n40/main/l10ntools/source/gConXhpWrap.cxx Mon Sep 30
11:57:33 2013
@@ -274,7 +274,7 @@ void convert_xhp::closeTransTag(char *yy
if (meExpectValue == VALUE_IS_VALUE || meExpectValue == VALUE_IS_VALUE_TAG)
{
if (msCollector.size() && msCollector != "-")
- mcMemory.setSourceKey(miLineNo, msSourceFile, msKey, msCollector);
+ mcMemory.setSourceKey(miLineNo, msSourceFile, msKey, msCollector,
mbMergeMode);
msKey.clear();
iType = 2;
}
Modified: openoffice/branches/l10n40/main/l10ntools/source/gConXrmWrap.cxx
URL:
http://svn.apache.org/viewvc/openoffice/branches/l10n40/main/l10ntools/source/gConXrmWrap.cxx?rev=1527521&r1=1527520&r2=1527521&view=diff
==============================================================================
--- openoffice/branches/l10n40/main/l10ntools/source/gConXrmWrap.cxx (original)
+++ openoffice/branches/l10n40/main/l10ntools/source/gConXrmWrap.cxx Mon Sep 30
11:57:33 2013
@@ -146,6 +146,7 @@ void convert_xrm::stopCollectData(char *
copySource(yytext);
if (!mbNoCollectingData)
{
+ mcMemory.setSourceKey(miLineNo, msSourceFile, msKey, sText, mbMergeMode);
mbNoCollectingData = true;
if (mbMergeMode)
{
@@ -165,8 +166,6 @@ void convert_xrm::stopCollectData(char *
writeSourceFile(sTagText);
}
}
- else
- mcMemory.setSourceKey(miLineNo, msSourceFile, msKey, sText);
msKey.clear();
}
mbIsTag = false;
Modified: openoffice/branches/l10n40/main/l10ntools/source/gConXrmlex.l
URL:
http://svn.apache.org/viewvc/openoffice/branches/l10n40/main/l10ntools/source/gConXrmlex.l?rev=1527521&r1=1527520&r2=1527521&view=diff
==============================================================================
--- openoffice/branches/l10n40/main/l10ntools/source/gConXrmlex.l (original)
+++ openoffice/branches/l10n40/main/l10ntools/source/gConXrmlex.l Mon Sep 30
11:57:33 2013
@@ -75,7 +75,7 @@ SP [ \t]*
}
-
+"<title " |
"<h"[0-9]" " |
"<p " {
LOCptr->setTag(yytext);
@@ -83,6 +83,7 @@ SP [ \t]*
+"</title>"[ \t\r]*[\n] |
"</h"[0-9]">"[ \t\r]*[\n] |
"</p>"[ \t\r]*[\n] {
LOCptr->stopCollectData(yytext);
Modified: openoffice/branches/l10n40/main/l10ntools/source/gL10nMem.cxx
URL:
http://svn.apache.org/viewvc/openoffice/branches/l10n40/main/l10ntools/source/gL10nMem.cxx?rev=1527521&r1=1527520&r2=1527521&view=diff
==============================================================================
--- openoffice/branches/l10n40/main/l10ntools/source/gL10nMem.cxx (original)
+++ openoffice/branches/l10n40/main/l10ntools/source/gL10nMem.cxx Mon Sep 30
11:57:33 2013
@@ -93,8 +93,8 @@ void l10nMem::setConvert(bool bC, bool b
{ l10nMem_impl::mcImpl->mcDb.setConvert(bC, bS); }
void l10nMem::loadEntryKey(int iL, const std::string& sS, const std::string&
sK, const std::string& sO, const std::string& sT, bool bI)
{ l10nMem_impl::mcImpl->loadEntryKey(iL, sS, sK, sO, sT, bI); }
-void l10nMem::setSourceKey(int iL, const std::string& sF, const std::string&
sK, const std::string& sT)
- { l10nMem_impl::mcImpl->setSourceKey(iL, sF, sK, sT); }
+void l10nMem::setSourceKey(int iL, const std::string& sF, const std::string&
sK, const std::string& sT, bool bM)
+ { l10nMem_impl::mcImpl->setSourceKey(iL, sF, sK, sT, bM); }
void l10nMem::saveTemplates(const std::string& sT, bool bK, bool bF)
{ l10nMem_impl::mcImpl->saveTemplates(*this, sT, bK, bF); }
void l10nMem::saveLanguages(const std::string& sT, bool bF)
@@ -194,12 +194,12 @@ void l10nMem_impl::loadEntryKey(int
void l10nMem_impl::setSourceKey(int iLineNo,
const std::string& sSourceFile,
const std::string& sKey,
- const std::string& sMsgId)
+ const std::string& sMsgId,
+ bool bMustExist)
{
std::string newText(sMsgId);
int i;
-
// time to escape " and \ if contained in text or key
for (i = 0; (i = newText.find("\\", i)) != (int)std::string::npos;)
{
@@ -228,8 +228,11 @@ void l10nMem_impl::setSourceKey(int
}
else
{
- // add key, if changed text, this is wrong but handled in reorganize
- mcDb.addKey(iLineNo, sSourceFile, sKey, newText, l10nMem::ENTRY_ADDED);
+ if (bMustExist)
+ throw l10nMem::showError("key " + sKey + " does not exist");
+ else
+ // add key, if changed text, this is wrong but handled in reorganize
+ mcDb.addKey(iLineNo, sSourceFile, sKey, newText, l10nMem::ENTRY_ADDED);
}
}
Modified: openoffice/branches/l10n40/main/l10ntools/source/gL10nMem.hxx
URL:
http://svn.apache.org/viewvc/openoffice/branches/l10n40/main/l10ntools/source/gL10nMem.hxx?rev=1527521&r1=1527520&r2=1527521&view=diff
==============================================================================
--- openoffice/branches/l10n40/main/l10ntools/source/gL10nMem.hxx (original)
+++ openoffice/branches/l10n40/main/l10ntools/source/gL10nMem.hxx Mon Sep 30
11:57:33 2013
@@ -176,7 +176,8 @@ class l10nMem_impl
void setSourceKey (int iLineNo,
const std::string& sFilename,
const std::string& sKey,
- const std::string& sMsgId);
+ const std::string& sMsgId,
+ bool bMustExist);
void saveTemplates (l10nMem& cMem,
const std::string& sTargetDir,
Modified: openoffice/branches/l10n40/main/l10ntools/source/gLang.hxx
URL:
http://svn.apache.org/viewvc/openoffice/branches/l10n40/main/l10ntools/source/gLang.hxx?rev=1527521&r1=1527520&r2=1527521&view=diff
==============================================================================
--- openoffice/branches/l10n40/main/l10ntools/source/gLang.hxx (original)
+++ openoffice/branches/l10n40/main/l10ntools/source/gLang.hxx Mon Sep 30
11:57:33 2013
@@ -81,7 +81,8 @@ class l10nMem
void setSourceKey (int iLineNo,
const std::string& sFilename,
const std::string& sKey,
- const std::string& sText);
+ const std::string& sText,
+ bool bMustExist);
void saveTemplates (const std::string& sTargetDir,
bool bKid,
Modified:
openoffice/branches/l10n40/main/languages/source/templates/readlicense_oo.pot
URL:
http://svn.apache.org/viewvc/openoffice/branches/l10n40/main/languages/source/templates/readlicense_oo.pot?rev=1527521&r1=1527520&r2=1527521&view=diff
==============================================================================
---
openoffice/branches/l10n40/main/languages/source/templates/readlicense_oo.pot
(original)
+++
openoffice/branches/l10n40/main/languages/source/templates/readlicense_oo.pot
Mon Sep 30 11:57:33 2013
@@ -31,6 +31,10 @@ msgstr ""
"X-Generator: genLang\n"
+#: readme.xrm#TITLE
+msgid "${PRODUCTNAME} Readme File"
+msgstr ""
+
#: readme.xrm#WELCOME
msgid "${PRODUCTNAME} ${PRODUCTVERSION} ReadMe"
msgstr ""