From 0be7e28b0cf1d972199574c5dc7c5937d237fbbd Mon Sep 17 00:00:00 2001 From: Albert Date: Sun, 20 Oct 2013 14:14:07 +0200 Subject: Patch regarding generating the rules file for the windows build regarding languages, some inconsistencies in the (windows) build system, corrections to some spelling. - maintainers.txt Spelling correction - config.xml Added missing languages Extended some descriptions - htmlhelp.cpp Added missing languages Spelling corrections - language.cpp Corrected call in respect to Serbian-Cyrillic - translator_br.h Spelling correction - translator_fa.h Corrected (not used) define in respect to LeftToRight - translator_mk.h Spelling correction - translator_sc.h Corrected in respect to consistency for Serbian-Cyrillic - Doxygen.sln Added project dependency as otherwise there might be a problem with the generation of version.cpp - Doxygen.vcproj Added rules for selecting languages to be used during translation Corrected some incorrect references / directories Corrected names of generated files / directories so they won't overwrite / conflict (especially during parallel builds) Corrected name of genhead <-> gen_head (consistency with rules file) - Doxywizard.vcproj Corrected some incorrect references / directories Corrected names of generated files / directories so they won't overwrite / conflict (especially during parallel builds) Note place of resulting executable has hanged (more consistent now) - Settings.rules Corrected place where configure file can be found - Version.rules Corrected place where configure file can be found - doxyindexer.vcproj Corrected some incorrect references / directories Corrected names of generated files / directories so they won't overwrite / conflict (especially during parallel builds) - doxysearch.vcproj Corrected some incorrect references / directories Corrected names of generated files / directories so they won't overwrite / conflict (especially during parallel builds) - iconv.vcproj Corrected some incorrect references / directories Corrected names of generated files / directories so they won't overwrite / conflict (especially during parallel builds) - qtools.vcproj Corrected some incorrect references / directories Corrected names of generated files / directories so they won't overwrite / conflict (especially during parallel builds) - lang_cfg.py Script to generate the file lang_cfg.h based on the specified languages in the windows GUI or in the configure script. - languages.py Script to generate languages pane in the windows GUI This file has to be called outside visual studio as it generates the rules for the Languages pane in the GUI (command on src directory python languages.py > ..\winbuild\Languages.rules) - Languages.rules Result file from language.py (old file was completely wrong and not used) This file has to be generated outside visual studio as it contains the rules for the Languages pane in the GUI - configure Use lang_cfg.py script (consistency) instead of (internal) perl script. --- configure | 26 +- doc/maintainers.txt | 2 +- src/config.xml | 16 +- src/htmlhelp.cpp | 6 +- src/lang_cfg.py | 8 + src/language.cpp | 4 +- src/languages.py | 106 +++++ src/translator_br.h | 2 +- src/translator_fa.h | 2 +- src/translator_mk.h | 2 +- src/translator_sc.h | 4 +- winbuild/Doxygen.sln | 5 +- winbuild/Doxygen.vcproj | 420 +++++++++++--------- winbuild/Doxywizard.vcproj | 110 ++++-- winbuild/Languages.rules | 917 +++++++++++++++++++++++++++++++++++++++++--- winbuild/Settings.rules | 2 +- winbuild/Version.rules | 4 +- winbuild/doxyindexer.vcproj | 12 +- winbuild/doxysearch.vcproj | 14 +- winbuild/iconv.vcproj | 4 + winbuild/qtools.vcproj | 12 +- 21 files changed, 1363 insertions(+), 315 deletions(-) create mode 100644 src/lang_cfg.py create mode 100755 src/languages.py diff --git a/configure b/configure index dd4344d..02ec303 100755 --- a/configure +++ b/configure @@ -52,7 +52,6 @@ f_libclangstatic=NO # list will be in case as specified (f_langs) and in uppercase (f_ulangs) as used in the internal perl script # f_langs=`ls -1 src/translator_??.h | sed -e 's%src/translator_%%g' | sed -e 's/\.h//' | tr '\012' ',' | sed -e 's/,$//'` -f_ulangs=`echo $f_langs | tr '[a-z]' '[A-Z]'` while test -n "$1"; do case $1 in @@ -800,12 +799,6 @@ TMAKE_MOC = $QTDIR/bin/moc EOF fi -if test "$f_english" = YES; then - cat >> .tmakeconfig <> .tmakeconfig <); - chomp @l; - @allowed=(split(/,/,"'$f_ulangs'")); - foreach my $elem (@l){ - $elem =~ tr/a-z/A-Z/; - $r=0; - foreach my $tst (@allowed){ - if ($tst eq $elem) { $r=1; last; } - } - if ($r!=1) { die "ERROR: Invalid language $elem was selected!\n"; } - print "#define LANG_$elem\n"; - };' > ./src/lang_cfg.h +if test "$f_english" = YES; then + $f_python src/lang_cfg.py ENONLY > src/lang_cfg.h +else + f_ulangs=`echo $f_langs | tr '[a-z,]' '[A-Z ]'` + $f_python src/lang_cfg.py $f_ulangs > src/lang_cfg.h +fi if test -f "src/config.h"; then chmod u+w src/config.h diff --git a/doc/maintainers.txt b/doc/maintainers.txt index ab2c1a0..1c76647 100644 --- a/doc/maintainers.txt +++ b/doc/maintainers.txt @@ -134,7 +134,7 @@ Alexandr Chelpanov: cav at cryptopro dot ru TranslatorSerbian Dejan Milosavljevic: [unreachable] dmilos at email dot com -TranslatorSerbianCyrilic +TranslatorSerbianCyrillic Nedeljko Stefanovic: stenedjo at yahoo dot com TranslatorSlovak diff --git a/src/config.xml b/src/config.xml index 06654b9..e9c9add 100644 --- a/src/config.xml +++ b/src/config.xml @@ -289,6 +289,7 @@ Go to the next section or return to the + @@ -297,28 +298,31 @@ Go to the next section or return to the - + - + + - + - + - + - + + + diff --git a/src/htmlhelp.cpp b/src/htmlhelp.cpp index 6b1f98b..c4cca17 100644 --- a/src/htmlhelp.cpp +++ b/src/htmlhelp.cpp @@ -406,7 +406,7 @@ void HtmlHelp::initialize() s_languageDict.insert("norwegian", new QCString("0x814 Norwegian")); s_languageDict.insert("polish", new QCString("0x415 Polish")); s_languageDict.insert("portuguese", new QCString("0x816 Portuguese(Portugal)")); - s_languageDict.insert("brazil", new QCString("0x416 Portuguese(Brazil)")); + s_languageDict.insert("brazilian", new QCString("0x416 Portuguese(Brazil)")); s_languageDict.insert("russian", new QCString("0x419 Russian")); s_languageDict.insert("spanish", new QCString("0x40A Spanish(Traditional Sort)")); s_languageDict.insert("swedish", new QCString("0x41D Swedish")); @@ -433,6 +433,10 @@ void HtmlHelp::initialize() s_languageDict.insert("persian", new QCString("0x429 Persian (Iran)")); s_languageDict.insert("arabic", new QCString("0xC01 Arabic (Egypt)")); s_languageDict.insert("latvian", new QCString("0x426 Latvian")); + s_languageDict.insert("macedonian", new QCString("0x042f Macedonian (Former Yugoslav Republic of Macedonia)")); + s_languageDict.insert("armenian", new QCString("0x42b Armenian")); + s_languageDict.insert("esperanto", new QCString("0x48f Esperanto")); + s_languageDict.insert("serbian-cyrillic", new QCString("0xC1A Serbian (Serbia, Cyrillic)")); } diff --git a/src/lang_cfg.py b/src/lang_cfg.py new file mode 100644 index 0000000..9ba1319 --- /dev/null +++ b/src/lang_cfg.py @@ -0,0 +1,8 @@ +import sys + +if (len(sys.argv) > 0): + if (sys.argv[1] == "ENONLY"): + print "#define ENGLISH_ONLY" + else: + for x in xrange(1, len(sys.argv)): + print "#define LANG_%s"%(sys.argv[x]) diff --git a/src/language.cpp b/src/language.cpp index eb88455..c993323 100644 --- a/src/language.cpp +++ b/src/language.cpp @@ -354,9 +354,9 @@ bool setTranslator(const char *langName) } #endif #ifdef LANG_SC - else if (L_EQUAL("serbian-cyrilic")) + else if (L_EQUAL("serbian-cyrillic") || L_EQUAL("serbiancyr")) /* serbiancyr for consistency with older versions */ { - theTranslator=new TranslatorSerbian; + theTranslator=new TranslatorSerbianCyrillic; } #endif #ifdef LANG_CA diff --git a/src/languages.py b/src/languages.py new file mode 100755 index 0000000..0005e88 --- /dev/null +++ b/src/languages.py @@ -0,0 +1,106 @@ +# +# This file is an aid to generated the Languages rules file. +# usage: +# python languages.py > ..\winbuild\Languages.rules +# +import os +import re + +files = [f for f in os.listdir('.') if re.match(r'translator_[a-z][a-z]\.h', f)] +new_list = [] +for f in files: + new_list.append([f,(os.path.splitext(f)[0]).replace("translator_","").upper()]) + +# +# generating file is lang_cfg.py +# the rules file has to output lang_cfg.h +# +print """\ + + + + + + + + + + + +""" +# +# generate loop, English is mandatory (so cannot be chosen) +# +for f in new_list: + if (f[1] != "EN"): + # search for the language description + fil = open(f[0], 'r') + tmp = "" + for line in fil: + if "idLanguage" in line: + tmp = line + if "}" in line: + break + elif (tmp != ""): + tmp += line + if "}" in line: + break + + tmp = tmp.replace("\n","") + l = re.sub('[^"]*"([^"]*)".*','\\1',tmp) + l1 = l.replace("-","") + # capatalize first letter + l = l.title() + print """\ + + + + + + + """ % (l1, l, l, l, f[1], l) + +print """\ + + + + +""" diff --git a/src/translator_br.h b/src/translator_br.h index b136f59..f9dba84 100644 --- a/src/translator_br.h +++ b/src/translator_br.h @@ -49,7 +49,7 @@ class TranslatorBrazilian : public TranslatorAdapter_1_8_0 */ virtual QCString idLanguage() { - return "brazil"; + return "brazilian"; } /*! Used to get the command(s) for the language support. This method diff --git a/src/translator_fa.h b/src/translator_fa.h index b9bbe14..bcc0572 100644 --- a/src/translator_fa.h +++ b/src/translator_fa.h @@ -35,7 +35,7 @@ #define TRANSLATOR_FA_H #define HtmlRightToLeft QCString("
") -#define HtmlLeftToRight QCString("
") +#define HtmlLeftToRight QCString("
") #define HtmlDivEnd QCString("
") diff --git a/src/translator_mk.h b/src/translator_mk.h index 15da8e1..b753756 100644 --- a/src/translator_mk.h +++ b/src/translator_mk.h @@ -16,7 +16,7 @@ */ // Тranslated by Slave Jovanovski // -// The cyrilic strings were entered using Macedonian language support in +// The cyrillic strings were entered using Macedonian language support in // Windows. The editor used was Eclipse 3.2. The file was saved in UTF-8. // // Updates: diff --git a/src/translator_sc.h b/src/translator_sc.h index 37519d2..af2d7df 100644 --- a/src/translator_sc.h +++ b/src/translator_sc.h @@ -40,7 +40,7 @@ Translator class (by the local maintainer) when the localized translator is made up-to-date again. */ -class TranslatorSerbianCyrilic : public TranslatorAdapter_1_6_0 +class TranslatorSerbianCyrillic : public TranslatorAdapter_1_6_0 { public: @@ -53,7 +53,7 @@ class TranslatorSerbianCyrilic : public TranslatorAdapter_1_6_0 * the identification used in language.cpp. */ virtual QCString idLanguage() - { return "serbiancyr"; } + { return "serbian-cyrillic"; } /*! Used to get the LaTeX command(s) for the language support. * This method should return string with commands that switch diff --git a/winbuild/Doxygen.sln b/winbuild/Doxygen.sln index 8f2fba5..52a0973 100644 --- a/winbuild/Doxygen.sln +++ b/winbuild/Doxygen.sln @@ -1,6 +1,6 @@  Microsoft Visual Studio Solution File, Format Version 10.00 -# Visual Studio 2008 +# Visual C++ Express 2008 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Doxygen", "Doxygen.vcproj", "{309C9A4A-94D2-4837-9A11-45B0A6CF35C3}" ProjectSection(ProjectDependencies) = postProject {B6BB4771-8A4E-4656-AC08-1EF8AC182F64} = {B6BB4771-8A4E-4656-AC08-1EF8AC182F64} @@ -9,6 +9,9 @@ EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "qtools", "qtools.vcproj", "{B6BB4771-8A4E-4656-AC08-1EF8AC182F64}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "doxywizard", "Doxywizard.vcproj", "{77C9C2D3-EA3F-3D59-8B4C-0ED852890172}" + ProjectSection(ProjectDependencies) = postProject + {309C9A4A-94D2-4837-9A11-45B0A6CF35C3} = {309C9A4A-94D2-4837-9A11-45B0A6CF35C3} + EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "doxysearch", "doxysearch.vcproj", "{F3F3408F-F6F7-46C7-BF1E-1FA056E0AE20}" EndProject diff --git a/winbuild/Doxygen.vcproj b/winbuild/Doxygen.vcproj index 5137f9a..b687c4c 100644 --- a/winbuild/Doxygen.vcproj +++ b/winbuild/Doxygen.vcproj @@ -1,7 +1,7 @@ + + + + + + + - - @@ -545,6 +570,10 @@ > + + @@ -577,6 +606,10 @@ > + + @@ -841,17 +874,17 @@ > - + @@ -894,22 +927,22 @@ + + + + + + + + + + + + + + + + @@ -2743,7 +2811,7 @@ /> @@ -318,7 +320,7 @@ @@ -333,7 +335,7 @@ @@ -344,7 +346,7 @@ @@ -359,7 +361,7 @@ @@ -370,7 +372,7 @@ @@ -385,7 +387,7 @@ @@ -396,7 +398,7 @@ @@ -411,7 +413,7 @@ @@ -422,7 +424,7 @@ @@ -437,7 +439,7 @@ @@ -448,7 +450,7 @@ @@ -463,7 +465,7 @@ @@ -474,17 +476,13 @@ - - @@ -504,7 +502,7 @@ @@ -580,6 +578,20 @@ RelativePath="..\src\settings.py" > + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - + Name="languages" + Version="8.00" + > + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/winbuild/Settings.rules b/winbuild/Settings.rules index b72dd16..5de8bee 100644 --- a/winbuild/Settings.rules +++ b/winbuild/Settings.rules @@ -10,7 +10,7 @@ CommandLine="python $(InputPath) [AllOptions] [AdditionalOptions] [inputs]" Outputs="$(InputDir)../src/$(InputName).h" FileExtensions="*.py" - AdditionalDependencies="$(ProjectDir)..\src\configure" + AdditionalDependencies="$(ProjectDir)..\configure" ExecutionDescription="Executing Settings ..." ShowOnlyRuleProperties="false" > diff --git a/winbuild/Version.rules b/winbuild/Version.rules index 7e85679..149d97b 100644 --- a/winbuild/Version.rules +++ b/winbuild/Version.rules @@ -8,9 +8,9 @@ Name="Version" DisplayName="Version" CommandLine="python $(InputPath) [AllOptions] [AdditionalOptions] [inputs]" - Outputs="$(InputDir)../src/$(InputName).cpp" + Outputs="$(InputDir)..\src\$(InputName).cpp" FileExtensions="*.py" - AdditionalDependencies="$(ProjectDir)..\src\configure" + AdditionalDependencies="$(ProjectDir)..\configure" ExecutionDescription="Executing Version ..." ShowOnlyRuleProperties="false" > diff --git a/winbuild/doxyindexer.vcproj b/winbuild/doxyindexer.vcproj index b158c77..f15055b 100644 --- a/winbuild/doxyindexer.vcproj +++ b/winbuild/doxyindexer.vcproj @@ -25,6 +25,7 @@ IntermediateDirectory="$(ConfigurationName)" ConfigurationType="1" CharacterSet="1" + BuildLogFile="$(IntDir)\$(TargetName)BuildLog.htm" >