Kaydet (Commit) aad4aa64 authored tarafından jan iversen's avatar jan iversen

genlang .tree ==> .pot identical.

the conversion .tree to .pot works

Added script gRun.sh with local call of genlang until integrated
gList.sh find all files to be translated.
For now, files that should be translated but are not, are ignored
this is due to 100% compatibility with current executables.

Research shows that .tree and .xhp are handled by the same old
executable to the .pot files are not complete.

Change-Id: I1634207b72075e74438ebfbc22a7753cdddd20ed
üst 095ca2a2
......@@ -49,6 +49,7 @@ class convert_po : public convert_gen
const string& sKey,
const string& sENUStext,
const string& sText,
const string& sResource,
bool bFuzzy);
void endSave();
......
......@@ -43,7 +43,7 @@ class convert_tree : public convert_gen
~convert_tree();
void setString (char *yytext);
void setState (char *yytext, STATE_TAG eNewStateTag, STATE_VAL eNewStateVAL);
void setState (char *yytext, STATE_TAG eNewStateTag, STATE_VAL eNewStateVAL, char *sModule);
void setValue (char *yytext);
string& copySourceSpecial (char *yytext, int iType);
void writeSourceFile (string& sText, int inx);
......
......@@ -43,6 +43,8 @@ class l10nMem
void setModuleName(const string& sModuleName);
const string& getModuleName(void);
void setResourceName(const string& sResourceName);
const string& getResourceName(void);
void setLanguage(const string& sLanguage,
bool bCreate);
void setConvert(bool bConvert,
......@@ -82,6 +84,7 @@ class l10nMem
bool mbDebug;
bool mbInError;
string msModuleName;
string msResourceName;
int miCurFileInx;
int miCurLangInx;
int miCurENUSinx;
......
......@@ -188,6 +188,7 @@ void convert_po::save(const string& sFileName,
const string& sKey,
const string& sENUStext,
const string& sText,
const string& sResource,
bool bFuzzy)
{
string sName;
......@@ -204,7 +205,7 @@ void convert_po::save(const string& sFileName,
<< "msgctxt \"\"" << endl
<< "\"" << sName << "\\n\"" << endl
<< "\"" << sKey << "\\n\"" << endl
<< "\"readmeitem.text\"" << endl;
<< "\"" << sResource << ".text\"" << endl;
if (bFuzzy)
outFile << "#, fuzzy" << endl;
outFile << "msgid \"" << sENUStext << "\"" << endl
......
......@@ -55,6 +55,8 @@ void convert_tree::doExecute()
string sLang;
string sFile, sFile2;
mcMemory.setResourceName("help_section");
if (mbMergeMode)
throw l10nMem::showError("Merge not implemented");
......@@ -114,12 +116,14 @@ void convert_tree::setString(char *yytext)
void convert_tree::setState(char *yytext, STATE_TAG eNewStateTag, STATE_VAL eNewStateVAL)
void convert_tree::setState(char *yytext, STATE_TAG eNewStateTag, STATE_VAL eNewStateVAL, char *sModule)
{
copySourceSpecial(yytext, 0);
msCollector.clear();
meStateTag = eNewStateTag;
meStateVal = eNewStateVAL;
if (sModule)
mcMemory.setResourceName(sModule);
}
......
......@@ -44,6 +44,7 @@ convert_xrm::~convert_xrm()
extern int xrmlex(void);
void convert_xrm::doExecute()
{
mcMemory.setResourceName("readmeitem");
xrmlex();
// write last part of file.
......
......@@ -89,11 +89,13 @@ class l10nMem_enus_entry
public:
l10nMem_enus_entry(const string& sKey,
const string& sMsgId,
const string& sResource,
int iLineNo,
int iFileInx,
int iLangSize,
l10nMem::ENTRY_STATE eState)
: msMsgId(sMsgId),
msResId(sResource),
meState(eState),
miFileInx(iFileInx),
miLineNo(iLineNo)
......@@ -113,6 +115,7 @@ class l10nMem_enus_entry
string msKey; // key in po file and source file
string msMsgId; // en-US text from source file
string msResId; // Resource Id (to be used in msgcstr)
l10nMem::ENTRY_STATE meState; // status information
int miFileInx; // index of file name
int miLineNo; // line number
......@@ -133,10 +136,11 @@ l10nMem::l10nMem()
mbStrictMode(false)
{
myMem = this;
msModuleName = "default";
msResourceName = "";
mcFileList.push_back(l10nMem_file_entry("-genLang-", 0));
mcLangList.push_back(l10nMem_lang_list_entry("-genLang-"));
mcENUSlist.push_back(l10nMem_enus_entry("-genLang-", "-genLang-", 0, 0, 0, l10nMem::ENTRY_DELETED));
msModuleName = "default";
mcENUSlist.push_back(l10nMem_enus_entry("-genLang-", "-genLang-", "", 0, 0, 0, l10nMem::ENTRY_DELETED));
}
......@@ -200,6 +204,20 @@ const string& l10nMem::getModuleName()
void l10nMem::setResourceName(const string& sResourceName)
{
msResourceName = sResourceName;
}
const string& l10nMem::getResourceName()
{
return msResourceName;
}
void l10nMem::setLanguage(const string& sLanguage,
bool bCreate)
{
......@@ -354,7 +372,7 @@ void l10nMem::saveTemplates(const string& sTargetDir, bool bKid, bool bForce)
if (cE.meState == ENTRY_DELETED)
continue;
savePo.save(mcFileList[cE.miFileInx].msFileName, cE.msKey, cE.msMsgId, "", false);
savePo.save(mcFileList[cE.miFileInx].msFileName, cE.msKey, cE.msMsgId, "", cE.msResId, false);
}
savePo.endSave();
}
......@@ -899,7 +917,7 @@ void l10nMem::addKey(int iLineNo,
mcFileList.push_back(l10nMem_file_entry(sSourceFile, miCurENUSinx));
// and add entry at the back (no problem since it is a new file)
mcENUSlist.push_back(l10nMem_enus_entry(sKey, sMsgId, iLineNo, miCurFileInx,
mcENUSlist.push_back(l10nMem_enus_entry(sKey, sMsgId, msResourceName, iLineNo, miCurFileInx,
mcLangList.size(), eStat));
mcFileList[miCurFileInx].miEnd = miCurENUSinx;
}
......@@ -912,7 +930,7 @@ void l10nMem::addKey(int iLineNo,
curF.miEnd++;
miCurENUSinx = curF.miEnd;
mcENUSlist.insert(it + curF.miEnd,
l10nMem_enus_entry(sKey, sMsgId, iLineNo, miCurFileInx,
l10nMem_enus_entry(sKey, sMsgId, msResourceName, iLineNo, miCurFileInx,
mcLangList.size(), eStat));
for (int i = miCurFileInx + 1; i < iFsize; ++i) {
l10nMem_file_entry& curF2 = mcFileList[i];
......
......@@ -90,49 +90,49 @@ IDENT [\.a-zA-Z0-9_-]+
\> {
LOCptr->setState(yytext, convert_tree::STATE_TAG_VALUE, convert_tree::STATE_VAL_NONE);
LOCptr->setState(yytext, convert_tree::STATE_TAG_VALUE, convert_tree::STATE_VAL_NONE, NULL);
}
"id=" {
LOCptr->setState(yytext, convert_tree::STATE_TAG_NONE, convert_tree::STATE_VAL_ID);
LOCptr->setState(yytext, convert_tree::STATE_TAG_NONE, convert_tree::STATE_VAL_ID, NULL);
}
"application=" {
LOCptr->setState(yytext, convert_tree::STATE_TAG_NONE, convert_tree::STATE_VAL_APPL);
LOCptr->setState(yytext, convert_tree::STATE_TAG_NONE, convert_tree::STATE_VAL_APPL, NULL);
}
"title=" {
LOCptr->setState(yytext, convert_tree::STATE_TAG_NONE, convert_tree::STATE_VAL_TITLE);
LOCptr->setState(yytext, convert_tree::STATE_TAG_NONE, convert_tree::STATE_VAL_TITLE, NULL);
}
"<help_section " {
LOCptr->setState(yytext, convert_tree::STATE_TAG_HELPSEC, convert_tree::STATE_VAL_NONE);
LOCptr->setState(yytext, convert_tree::STATE_TAG_HELPSEC, convert_tree::STATE_VAL_NONE, "help_section");
}
"<node " {
LOCptr->setState(yytext, convert_tree::STATE_TAG_NODE, convert_tree::STATE_VAL_NONE);
LOCptr->setState(yytext, convert_tree::STATE_TAG_NODE, convert_tree::STATE_VAL_NONE, "node");
}
"<topic " {
LOCptr->setState(yytext, convert_tree::STATE_TAG_TOPIC, convert_tree::STATE_VAL_NONE);
//NOT NOW LOCptr->setState(yytext, convert_tree::STATE_TAG_TOPIC, convert_tree::STATE_VAL_NONE, NULL);
}
"</topic" {
LOCptr->setValue(yytext);
// NOT NOW LOCptr->setValue(yytext);
}
......@@ -153,7 +153,5 @@ IDENT [\.a-zA-Z0-9_-]+
void tree_dummyJustForCompiler()
{
char *txt = NULL;
// yy_flex_strlen(txt);
yyunput(0, txt);
yyunput(0, NULL);
}
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment