diff options
author | Dimitri van Heesch <dimitri@stack.nl> | 2013-10-20 12:35:26 (GMT) |
---|---|---|
committer | Dimitri van Heesch <dimitri@stack.nl> | 2013-10-20 12:35:26 (GMT) |
commit | 4447e7f3377d8abdc5d29e323d5c52fb3adaed89 (patch) | |
tree | bd7b36b89380002ea557bc572d814633560bf833 /src | |
parent | f18d76b3ab225958feb3a8dd6a2416fc3c6e2463 (diff) | |
parent | 0be7e28b0cf1d972199574c5dc7c5937d237fbbd (diff) | |
download | Doxygen-4447e7f3377d8abdc5d29e323d5c52fb3adaed89.zip Doxygen-4447e7f3377d8abdc5d29e323d5c52fb3adaed89.tar.gz Doxygen-4447e7f3377d8abdc5d29e323d5c52fb3adaed89.tar.bz2 |
Merge pull request #47 from albert-github/feature/build_language
Patch regarding generating the rules file for the windows build regardin...
Diffstat (limited to 'src')
-rw-r--r-- | src/config.xml | 16 | ||||
-rw-r--r-- | src/htmlhelp.cpp | 6 | ||||
-rw-r--r-- | src/lang_cfg.py | 8 | ||||
-rw-r--r-- | src/language.cpp | 4 | ||||
-rwxr-xr-x | src/languages.py | 106 | ||||
-rw-r--r-- | src/translator_br.h | 2 | ||||
-rw-r--r-- | src/translator_fa.h | 2 | ||||
-rw-r--r-- | src/translator_mk.h | 2 | ||||
-rw-r--r-- | src/translator_sc.h | 4 |
9 files changed, 136 insertions, 14 deletions
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 <a href="commands.html">next</a> section or return to the </docs> <value name='Afrikaans'/> <value name='Arabic'/> + <value name='Armenian'/> <value name='Brazilian'/> <value name='Catalan'/> <value name='Chinese'/> @@ -297,28 +298,31 @@ Go to the <a href="commands.html">next</a> section or return to the <value name='Czech'/> <value name='Danish'/> <value name='Dutch'/> - <value name='English'/> + <value name='English' desc='(United States)'/> <value name='Esperanto'/> - <value name='Farsi'/> + <value name='Farsi' desc='(Persian)'/> <value name='Finnish'/> <value name='French'/> <value name='German'/> <value name='Greek'/> <value name='Hungarian'/> + <value name='Indonesian'/> <value name='Italian'/> <value name='Japanese'/> - <value name='Japanese-en'/> + <value name='Japanese-en' desc='(Japanese with English messages)'/> <value name='Korean'/> - <value name='Korean-en'/> + <value name='Korean-en' desc='(Korean with English messages)'/> <value name='Latvian'/> - <value name='Norwegian'/> + <value name='Lithuanian'/> <value name='Macedonian'/> - <value name='Persian'/> + <value name='Norwegian'/> + <value name='Persian' desc='(Farsi)'/> <value name='Polish'/> <value name='Portuguese'/> <value name='Romanian'/> <value name='Russian'/> <value name='Serbian'/> + <value name='Serbian-Cyrillic'/> <value name='Slovak'/> <value name='Slovene'/> <value name='Spanish'/> 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 """\ +<?xml version="1.0" encoding="utf-8"?> +<VisualStudioToolFile + Name="languages" + Version="8.00" + > + <Rules> + <CustomBuildRule + Name="Languages" + DisplayName="Settings" + CommandLine="python $(InputPath) [AllOptions] [AdditionalOptions] > $(InputDir)../src/$(InputName).h" + Outputs="$(InputDir)../src/$(InputName).h" + FileExtensions="*.py" + AdditionalDependencies="" + ExecutionDescription="Executing languages ..." + ShowOnlyRuleProperties="false" + > + <Properties> + <EnumProperty + Name="EnglishOnly" + DisplayName="Use English Only" + Description="Use English Only" + DefaultValue="0" + > + <Values> + <EnumValue + Value="0" + Switch="" + DisplayName="Don't use English Only" + /> + <EnumValue + Value="1" + Switch="ENONLY" + DisplayName="Use English Only" + /> + </Values> + </EnumProperty> +""" +# +# 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 """\ + <EnumProperty + Name="%s" + DisplayName="Use %s" + Description="Use %s" + DefaultValue="1" + > + <Values> + <EnumValue + Value="0" + Switch="" + DisplayName="Don't use %s" + /> + <EnumValue + Value="1" + Switch="%s" + DisplayName="Use %s" + /> + </Values> + </EnumProperty> + """ % (l1, l, l, l, f[1], l) + +print """\ + </Properties> + </CustomBuildRule> + </Rules> +</VisualStudioToolFile> +""" 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("<div dir=\"rtl\">") -#define HtmlLeftToRight QCString("<div dir=\"rtl\">") +#define HtmlLeftToRight QCString("<div dir=\"ltr\">") #define HtmlDivEnd QCString("</div>") 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 <slavejovanovski@yahoo.com> // -// 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 |