Commit 99a2c4ad8f4ff4c2a8bc236d16b08bff82e8c372

Authored by Neil Blakey-Milner
1 parent 9909a358

Translate the buttons properly.


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@2994 c91229c3-7414-0410-bfa2-8a42b809f60b
presentation/lookAndFeel/knowledgeTree/documentmanagement/viewUI.inc
... ... @@ -384,6 +384,25 @@ function renderDependantDocuments($oDocument, $bEdit) {
384 384 return $sToRender;
385 385 }
386 386  
  387 +// This array exists only to give gettext a hint that these buttons
  388 +// should be added to the .po file.
  389 +
  390 +$aTranslatedButtons = array(
  391 + _("View"),
  392 + _("Email"),
  393 + _("Checkout"),
  394 + _("Delete"),
  395 + _("History"),
  396 + _("Move"),
  397 + _("Subscribe"),
  398 + _("Unsubscribe"),
  399 + _("Discussion"),
  400 + _("Archive"),
  401 + _("Link New Doc"),
  402 + _("Publish"),
  403 +);
  404 +
  405 +
387 406 $aImageNameToLabel = array(
388 407 "dependentdoc" => "Link new doc",
389 408 );
... ... @@ -407,7 +426,8 @@ function displayButton($sAction, $sQueryString, $sImageName, $sDisabledText = ""
407 426 } else {
408 427 $sLabel = $sImageName;
409 428 }
410   - $sLabel = strtoupper($sLabel);
  429 + $sTranslatedWords = _(ucwords($sLabel));
  430 + $sLabel = strtoupper($sTranslatedWords);
411 431 if ($bActive) {
412 432 $sClass = "button";
413 433 } else {
... ... @@ -428,7 +448,7 @@ function displayViewButton($oDocument, $bEdit) {
428 448 if ($default->useTextButtons === false) {
429 449 return "<tr><td align=\"left\"><a onClick=\"alert('$sViewAlert '); return true;\" href=\"" . generateControllerLink("downloadDocument", "fDocumentID=" . $oDocument->getID()) . "\"><img src=\"$default->graphicsUrl/widgets/docactions/view.gif\" border=\"0\" title=\"" . _("View the document") . "\"/></a></td></tr>\n";
430 450 } else {
431   - return "<a onClick=\"alert('$sViewAlert '); return true;\" href=\"" . generateControllerLink("downloadDocument", "fDocumentID=" . $oDocument->getID()) . "\"><span class=\"button\" title=\"" . _("View the document") . "\">VIEW</span></a>\n";
  451 + return "<a onClick=\"alert('$sViewAlert '); return true;\" href=\"" . generateControllerLink("downloadDocument", "fDocumentID=" . $oDocument->getID()) . "\"><span class=\"button\" title=\"" . _("View the document") . "\">" . strtoupper(_("View")) . "</span></a>\n";
432 452 }
433 453 }
434 454  
... ...