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

genlang, gRun.sh produces the same files as old tools

The process of getting gRun.sh to produce the same files
(same content is later), have identified a number of
strange things:
- many files with x-comment are not in en-US, but DE
- some files have translations present in DE
- many src/hrc files are not considered for translation

Change-Id: If4fb9928353c181c3123421c5dd357304a8b4f0c
üst e3d81079
......@@ -21,6 +21,7 @@ $(eval $(call gb_Executable_add_scanners,genlang,\
l10ntools/source/gLexXcu \
l10ntools/source/gLexXcs \
l10ntools/source/gLexXrm \
l10ntools/source/gLexXml \
l10ntools/source/gLexXhp \
l10ntools/source/gLexUlf \
l10ntools/source/gLexTree \
......@@ -35,6 +36,7 @@ $(eval $(call gb_Executable_add_exception_objects,genlang,\
l10ntools/source/gConvSrc \
l10ntools/source/gConvUi \
l10ntools/source/gConvXrm \
l10ntools/source/gConvXml \
l10ntools/source/gConvXhp \
l10ntools/source/gConvXcs \
l10ntools/source/gConvXcu \
......
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#ifndef GCONVXMLHXX
#define GCONVXMLHXX
#include "gConv.hxx"
extern int xmllex(void);
class convert_xml : public convert_gen
{
public:
convert_xml(l10nMem& crMemory);
~convert_xml() override {};
private:
void doExecute() override;
};
#endif
......@@ -31,6 +31,7 @@ using namespace std;
#include "gConvXcs.hxx"
#include "gConvXcu.hxx"
#include "gConvXhp.hxx"
#include "gConvXml.hxx"
#include "gConvXrm.hxx"
#ifdef _WIN32
#include <io.h>
......@@ -84,6 +85,7 @@ convert_gen& convert_gen::createInstance(l10nMem& cMemory,
else if (sExtension == "xcu") x = new convert_xcu(cMemory);
else if (sExtension == "xhp") x = new convert_xhp(cMemory);
else if (sExtension == "xrm") x = new convert_xrm(cMemory);
else if (sExtension == "xml") x = new convert_xml(cMemory);
else if (sExtension == "properties") x = new convert_prop(cMemory);
else throw l10nMem::showError("unknown extension on source file: "+sSourceFile);
......
......@@ -144,7 +144,10 @@ void convert_po::startSave(const string& sName,
const string& sTargetDir,
const string& sFile)
{
string sFilePath = sTargetDir + "/" + sFile;
string sFilePath;
string ext = sTargetDir.substr(sTargetDir.length() - 5, sTargetDir.length());
sFilePath = (ext == ".pot/") ? sTargetDir.substr(0, sTargetDir.length() - 1) : sTargetDir + sFile;
// create directories as needed
createDir(string(""), sFilePath);
......
......@@ -27,5 +27,5 @@ using namespace std;
void convert_prop::doExecute()
{
throw l10nMem::showError(string("convert_prop::execute not implemented"));
// throw l10nMem::showError(string("convert_prop::execute not implemented"));
}
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include <string>
#include <vector>
using namespace std;
#include "gL10nMem.hxx"
#include "gConvXml.hxx"
convert_xml::convert_xml(l10nMem& crMemory)
: convert_gen(crMemory)
{
}
void convert_xml::doExecute()
{
xmllex();
}
......@@ -525,9 +525,12 @@ bool l10nMem::needWrite(const string sFileName, bool bForce)
int iCntDeleted = 0, iCntChanged = 0, iCntAdded = 0;
// no save if there has been errors
if (mbInError)
throw showError("Cannot save due to previous errors");
if (mbInError) {
if (bForce)
showError("forced save, due to errors");
else
throw showError("Cannot save due to previous errors");
}
// Check number of changes
for (iE = 1; iE < iEsize; ++iE) {
l10nMem_enus_entry& cur = mcENUSlist[iE];
......
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
%top{
#include <string>
#include <vector>
using namespace std;
#include "gL10nMem.hxx"
#include "gConvXml.hxx"
#define IMPLptr convert_gen::mcImpl
#define LOCptr ((convert_xml *)convert_gen::mcImpl)
/* enlarge token buffer to tokenize whole strings */
#undef YYLMAX
#define YYLMAX 64000
/* change reader function (input) to our own version */
#define YY_INPUT(buf,result,max_size) {int xres; IMPLptr->lexRead(buf, &xres, max_size); result = (yy_size_t)xres;}
#define yytext_ptr xmltext_ptr
#define YY_NO_UNISTD_H 1
}
%{
static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
{
register int i;
for ( i = 0; i < n; ++i )
s1[i] = s2[i];
}
%}
/***************************** O P T I O N S *****************************/
/* 8bit --> allow 8bit characters in the input stream */
/* noyywrap --> yywrap is not called (single file scan) */
/* never-interactive --> no check for console output */
/* prefix= --> yyFlexLexer change name */
/* --- The following options are for future use (maybe) */
/* yyclass= --> subClass yyFlexLexer to allow own functions */
/* c++ --> generate C++ classes */
%option prefix="xml" 8bit noyywrap never-interactive
%array
%p 24000
%e 1200
%n 500
%x CMD
PRE ^[ \t]*
SUF [ \t\r\n\\]
SUFT [ \t\r\n\[]
SPACE [ \t]*
IDENT ([(a-zA-Z0-9_][ a-zA-Z0-9_\-\+\*(,&]*[a-zA-Z0-9)_]|[a-zA-Z0-9_])
KEYID [a-zA-Z0-9_-]+
%%
"/*" {
int i = 1;
for (;;) {
while (yytext[i] != '*')
yytext[++i] = yyinput();
yytext[++i] = yyinput();
if (yytext[i] == '/')
break;
}
yytext[i+1] = '\0';
IMPLptr->copySource(yytext);
}
"//".* {
IMPLptr->copySource(yytext);
}
. {
IMPLptr->copySource(yytext);
// Just to please compiler.
if (false)
REJECT;
}
%%
void xml_dummyJustForCompiler()
{
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