From a4cf65dea1371721f07c63c2bb5f9e5085b2618a Mon Sep 17 00:00:00 2001 From: kbinani Date: Mon, 1 Dec 2014 20:06:53 +0900 Subject: Fix bug: language switch command "\~" failed to detect language id which contains '-' Support language switch for language ids, 'Japanese-en', 'Korean-en', 'Serbian-Cyrillic', and similer langauge ids. --- src/commentscan.l | 4 ++-- testing/065/indexpage.xml | 10 ++++++++++ testing/065_tilde.dox | 12 ++++++++++++ 3 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 testing/065/indexpage.xml create mode 100644 testing/065_tilde.dox diff --git a/src/commentscan.l b/src/commentscan.l index 3bfd563..702a616 100644 --- a/src/commentscan.l +++ b/src/commentscan.l @@ -1120,7 +1120,7 @@ RCSTAG "$"{ID}":"[^\n$]+"$" {B}*("\\\\"|"@@")"f"[$\[{] { // escaped formula command addOutput(yytext); } -{B}*{CMD}"~"[a-z_A-Z]* { // language switch command +{B}*{CMD}"~"[a-z_A-Z-]* { // language switch command QCString langId = QString(yytext).stripWhiteSpace().data()+2; if (!langId.isEmpty() && qstricmp(Config_getEnum("OUTPUT_LANGUAGE"),langId)!=0) @@ -2160,7 +2160,7 @@ RCSTAG "$"{ID}":"[^\n$]+"$" /* ----- handle language specific sections ------- */ -[\\@]"~"[a-zA-Z]* { /* language switch */ +[\\@]"~"[a-zA-Z-]* { /* language switch */ QCString langId = &yytext[2]; if (langId.isEmpty() || qstricmp(Config_getEnum("OUTPUT_LANGUAGE"),langId)==0) diff --git a/testing/065/indexpage.xml b/testing/065/indexpage.xml new file mode 100644 index 0000000..e462e55 --- /dev/null +++ b/testing/065/indexpage.xml @@ -0,0 +1,10 @@ + + + + index + My Project + + これは日本語(en)です. Output for all languages. + + + diff --git a/testing/065_tilde.dox b/testing/065_tilde.dox new file mode 100644 index 0000000..0b4986f --- /dev/null +++ b/testing/065_tilde.dox @@ -0,0 +1,12 @@ +// objective: test \~ command with non default OUTPUT_LANGUAGE which contains '-' letter +// check: indexpage.xml +// config: OUTPUT_LANGUAGE = Japanese-en +/** +\mainpage +\~english This is English. +\~dutch Dit is Nederlands. +\~japanese これは日本語です. +\~japanese-en これは日本語(en)です. +\~german Dies ist Deutsch. +\~ Output for all languages. +*/ -- cgit v0.12