[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdegraphics/kviewshell/plugins/dvi
From:       Wilfried Huss <Wilfried.Huss () gmx ! at>
Date:       2006-07-10 20:00:40
Message-ID: 1152561640.547639.15954.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 560624 by whuss:

port of commit 558964:

Replace the link target names that are created by hyperref with proper translatable names.

 M  +61 -0     dviRenderer.cpp  


--- trunk/KDE/kdegraphics/kviewshell/plugins/dvi/dviRenderer.cpp #560623:560624
@@ -226,11 +226,72 @@
     }
   }
 
+  QRegExp chapterExp("chapter\\.(.*)");
+  QRegExp sectionExp("section\\.(.*)");
+  QRegExp subsectionExp("subsection\\.(.*)");
+  QRegExp figureExp("figure\\.(.*)");
+  QRegExp theoremExp("thm\\.(.*)");
+  QRegExp lemmaExp("lem\\.(.*)");
+  QRegExp remarkExp("rem\\.(.*)");
+  QRegExp exampleExp("bsp\\.(.*)");
+  QRegExp equationExp("equation\\.(.*)");
+  QRegExp itemExp("item\\.(.*)");
+  QRegExp citeExp("cite\\.(.*)");
+  
   // And finally add anchors to the links
   for (i = page->hyperLinkList.begin(); i != page->hyperLinkList.end(); i++)
   {
     Anchor anchor = findAnchor((*i).linkText);
     (*i).anchor = anchor;
+
+    // Also replace the targetnames created by the hyperref package,
+    // with proper translatable names.
+    QString temp = (*i).linkText;
+
+    if (chapterExp.exactMatch(temp))
+    {
+      (*i).linkText = i18n("Chapter %1", chapterExp.cap(1));
+    }
+    else if (sectionExp.exactMatch(temp))
+    {
+      (*i).linkText = i18n("Section %1", sectionExp.cap(1));
+    }
+    else if (subsectionExp.exactMatch(temp))
+    {
+      (*i).linkText = i18n("Subsection %1", subsectionExp.cap(1));
+    }
+    else if (figureExp.exactMatch(temp))
+    {
+      (*i).linkText = i18n("Figure %1", figureExp.cap(1));
+    }
+    else if (theoremExp.exactMatch(temp))
+    {
+      (*i).linkText = i18n("Theorem %1", theoremExp.cap(1));
+    }
+    else if (lemmaExp.exactMatch(temp))
+    {
+      (*i).linkText = i18n("Lemma %1", lemmaExp.cap(1));
+    }
+    else if (remarkExp.exactMatch(temp))
+    {
+      (*i).linkText = i18n("Remark %1", remarkExp.cap(1));
+    }
+    else if (exampleExp.exactMatch(temp))
+    {
+      (*i).linkText = i18n("Example %1", exampleExp.cap(1));
+    }
+    else if (equationExp.exactMatch(temp))
+    {
+      (*i).linkText = i18n("Equation %1", equationExp.cap(1));
+    }
+    else if (itemExp.exactMatch(temp))
+    {
+      (*i).linkText = i18n("Item %1", itemExp.cap(1));
+    }
+    else if (citeExp.exactMatch(temp))
+    {
+      (*i).linkText = i18n("Citation [%1]", citeExp.cap(1));
+    }
   }
   
   page->isEmpty = false;
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic