Commit f8dd743e2ea89ef01dfc6e55d7f8ded24d0dee02
1 parent
f597ddc7
Type: i18n implementation.
Description: Added gettext modifier to UI text. git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@2846 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
4 changed files
with
43 additions
and
39 deletions
lib/browse/Browser.inc
| ... | ... | @@ -60,18 +60,18 @@ class Browser { |
| 60 | 60 | // default sort criteria |
| 61 | 61 | global $browse_folder_sort_title, $browse_folder_sort_description, $browse_folder_sort_creator, $browse_folder_sort_date_created, $browse_folder_sort_document_type; |
| 62 | 62 | if (count($aNewSortCriteria) == 0) { |
| 63 | - $aNewSortCriteria = array ( "name" => array ("display" => $browse_folder_sort_title), | |
| 64 | - "filename" => array ("display" => $browse_folder_sort_description), | |
| 65 | - "creator_id" => array ("display" => $browse_folder_sort_creator, | |
| 63 | + $aNewSortCriteria = array ( "name" => array ("display" => _("Title")), | |
| 64 | + "filename" => array ("display" => _("Description")), | |
| 65 | + "creator_id" => array ("display" => _("Creator"), | |
| 66 | 66 | "lookup" => array ("table" => "users", |
| 67 | 67 | "field" => "name")), |
| 68 | 68 | |
| 69 | - "id" => array ("display" => $browse_folder_sort_date_created, | |
| 69 | + "id" => array ("display" => _("Date Created"), | |
| 70 | 70 | "lookup" => array("table" => "document_transactions", |
| 71 | 71 | "field" => "datetime", |
| 72 | 72 | "joinColumn" => "document_id", |
| 73 | 73 | "whereClause" => "transaction_id=1")), |
| 74 | - "document_type_id" => array ("display" => $browse_folder_sort_document_type, | |
| 74 | + "document_type_id" => array ("display" => _("Document Type"), | |
| 75 | 75 | "lookup" => array ("table" => "document_types_lookup", |
| 76 | 76 | "field" => "name")) ); |
| 77 | 77 | } | ... | ... |
presentation/login.php
| ... | ... | @@ -68,18 +68,18 @@ if ($loginAction == "loginForm") { |
| 68 | 68 | <br><br> |
| 69 | 69 | <table>\n |
| 70 | 70 | <form name=\"loginForm\" action=\"" . $_SERVER["PHP_SELF"] . "\" method=\"post\"> |
| 71 | - <tr><td>Please enter your details below to login</td></tr> | |
| 71 | + <tr><td>" . _("Please enter your details below to login") . "</td></tr> | |
| 72 | 72 | <tr><td></td></tr> |
| 73 | 73 | <tr><td><font color=\"red\">" . sanitize($errorMessage) . "</font><tr><td> |
| 74 | - \t<tr><td>Username:</td></tr> | |
| 74 | + \t<tr><td>" . _("Username") . ":</td></tr> | |
| 75 | 75 | \t<tr><td><input type=\"text\" name=\"fUserName\" size=\"35\"></td></tr> |
| 76 | - \t<tr><td>Password:</td></tr> | |
| 76 | + \t<tr><td>" . _("Password") . ":</td></tr> | |
| 77 | 77 | <tr><td><input type=\"password\" name=\"fPassword\" size=\"35\" onKeyPress=\"return submitenter(this,event)\"> |
| 78 | 78 | </td></tr> |
| 79 | 79 | <input type=\"hidden\" name=\"redirect\" value=\"$redirect\"/> |
| 80 | 80 | <input type=\"hidden\" name=\"loginAction\" value=\"login\">\n |
| 81 | 81 | <tr align=\"right\"><td><input type=\"image\" src=\"$default->graphicsUrl/icons/login.jpg\" border=\"0\"></td></tr>\n |
| 82 | - <tr><td><font size=\"1\">Version: " . $default->system->get("knowledgeTreeVersion") . "</font></td></tr> | |
| 82 | + <tr><td><font size=\"1\">" . _("Version") . ": " . $default->system->get("knowledgeTreeVersion") . "</font></td></tr> | |
| 83 | 83 | </table> |
| 84 | 84 | </center> |
| 85 | 85 | </body> |
| ... | ... | @@ -138,18 +138,18 @@ if ($loginAction == "loginForm") { |
| 138 | 138 | break; |
| 139 | 139 | // login disabled |
| 140 | 140 | case 2: |
| 141 | - $url = $url . "&errorMessage=" . urlencode("Account has been DISABLED, contact the System Adminstrator"); | |
| 141 | + $url = $url . "&errorMessage=" . urlencode(_("Account has been DISABLED, contact the System Adminstrator")); | |
| 142 | 142 | break; |
| 143 | 143 | // too many sessions |
| 144 | 144 | case 3 : |
| 145 | - $url = $url . "&errorMessage=" . urlencode("Maximum sessions for user reached.<br>Contact the System Administrator"); | |
| 145 | + $url = $url . "&errorMessage=" . urlencode(_("Maximum sessions for user reached.<br>Contact the System Administrator")); | |
| 146 | 146 | break; |
| 147 | 147 | // not a unit user |
| 148 | 148 | case 4 : |
| 149 | - $url = $url . "&errorMessage=" . urlencode("Not unit user- contact an Administrator"); | |
| 149 | + $url = $url . "&errorMessage=" . urlencode(_("Not unit user- contact an Administrator")); | |
| 150 | 150 | break; |
| 151 | 151 | default : |
| 152 | - $url = $url . "&errorMessage=" . urlencode("Login failure"); | |
| 152 | + $url = $url . "&errorMessage=" . urlencode(_("Login failure")); | |
| 153 | 153 | } |
| 154 | 154 | } else { |
| 155 | 155 | // didn't receive any login parameters, so redirect login form | ... | ... |
presentation/lookAndFeel/knowledgeTree/dashboardUI.inc
| ... | ... | @@ -53,7 +53,7 @@ function renderPendingWebDocuments($aPendingDocumentList) { |
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | function renderRestorationRequests($aRestorationRequests) { |
| 56 | - global $default, $dashboard_archived_document_restoration_heading; | |
| 56 | + global $default; | |
| 57 | 57 | |
| 58 | 58 | if (count($aRestorationRequests) > 0) { |
| 59 | 59 | $sBgColor = "#9D9D7F"; |
| ... | ... | @@ -62,7 +62,7 @@ function renderRestorationRequests($aRestorationRequests) { |
| 62 | 62 | } |
| 63 | 63 | $sToRender = "\t\t\t<tr align=\"left\" bgcolor=\"$sBgColor\">\n"; |
| 64 | 64 | |
| 65 | - $sToRender .= "\t\t\t\t<th class=\"sectionHeading\" colspan=\"2\"><font color=\"ffffff\">" . $$dashboard_archived_document_restoration_heading . "</font></th>\n"; | |
| 65 | + $sToRender .= "\t\t\t\t<th class=\"sectionHeading\" colspan=\"2\"><font color=\"ffffff\">" . _("Archived Document Restoration Requests") . "</font></th>\n"; | |
| 66 | 66 | $sToRender .= "\t\t\t</tr>\n"; |
| 67 | 67 | for ($i = 0; $i < count($aRestorationRequests); $i++) { |
| 68 | 68 | $oDocument = Document::get($aRestorationRequests[$i]->getDocumentID()); |
| ... | ... | @@ -90,7 +90,7 @@ function renderPendingCollaborationDocuments($aPendingDocumentList) { |
| 90 | 90 | } |
| 91 | 91 | $sToRender = "\t\t\t<tr align=\"left\" bgcolor=\"$sBgColor\">\n"; |
| 92 | 92 | |
| 93 | - $sToRender .= "\t\t\t\t<th class=\"sectionHeading\" colspan=\"2\"><font color=\"ffffff\">" . $dashboard_pending_documents_heading . "</font></th>\n"; | |
| 93 | + $sToRender .= "\t\t\t\t<th class=\"sectionHeading\" colspan=\"2\"><font color=\"ffffff\">" . _("Pending Documents") . "</font></th>\n"; | |
| 94 | 94 | $sToRender .= "\t\t\t</tr>\n"; |
| 95 | 95 | for ($i = 0; $i < count($aPendingDocumentList); $i++) { |
| 96 | 96 | $oDocument = $aPendingDocumentList[$i]; |
| ... | ... | @@ -109,14 +109,14 @@ function renderPendingCollaborationDocuments($aPendingDocumentList) { |
| 109 | 109 | * @param array of checked out documents |
| 110 | 110 | */ |
| 111 | 111 | function renderCheckedOutDocuments($aCheckedOutDocumentList) { |
| 112 | - global $default, $dashboard_checked_out_documents_heading; | |
| 112 | + global $default; | |
| 113 | 113 | if (count($aCheckedOutDocumentList) > 0) { |
| 114 | 114 | $sBgColor = "#9D9D7F"; |
| 115 | 115 | } else { |
| 116 | 116 | $sBgColor = "#CECEBF"; |
| 117 | 117 | } |
| 118 | 118 | $sToRender = "\t\t\t<tr align=\"left\" bgcolor=\"$sBgColor\">\n"; |
| 119 | - $sToRender .= "\t\t\t\t<th class=\"sectionHeading\" colspan=\"2\"><font color=\"ffffff\">" . $dashboard_checked_out_documents_heading . "</font></th>\n"; | |
| 119 | + $sToRender .= "\t\t\t\t<th class=\"sectionHeading\" colspan=\"2\"><font color=\"ffffff\">" . _("Checked Out Documents") . "</font></th>\n"; | |
| 120 | 120 | $sToRender .= "\t\t\t</tr>\n"; |
| 121 | 121 | |
| 122 | 122 | if (count($aCheckedOutDocumentList) > 0) { |
| ... | ... | @@ -146,14 +146,14 @@ function renderCheckedOutDocuments($aCheckedOutDocumentList) { |
| 146 | 146 | * @param array of subscription alerts |
| 147 | 147 | */ |
| 148 | 148 | function renderSubscriptionAlerts($aSubscriptionAlertList) { |
| 149 | - global $default, $dashboard_subscription_alerts_heading; | |
| 149 | + global $default; | |
| 150 | 150 | if (count($aSubscriptionAlertList) > 0) { |
| 151 | 151 | $sBgColor = "#9D9D7F"; |
| 152 | 152 | } else { |
| 153 | 153 | $sBgColor = "#CECEBF"; |
| 154 | 154 | } |
| 155 | 155 | $sToRender = "\t\t\t<tr align=\"left\" bgcolor=\"$sBgColor\">\n"; |
| 156 | - $sToRender .= "\t\t\t\t<th class=\"sectionHeading\" colspan=\"2\"><font color=\"ffffff\">" . $dashboard_subscription_alerts_heading . "</font></th>\n"; | |
| 156 | + $sToRender .= "\t\t\t\t<th class=\"sectionHeading\" colspan=\"2\"><font color=\"ffffff\">" . _("Subscription Alerts") . "</font></th>\n"; | |
| 157 | 157 | $sToRender .= "\t\t\t</tr>\n"; |
| 158 | 158 | for ($i = 0; $i < count($aSubscriptionAlertList); $i++) { |
| 159 | 159 | $sToRender .= "\t\t\t<tr>\n"; |
| ... | ... | @@ -164,14 +164,14 @@ function renderSubscriptionAlerts($aSubscriptionAlertList) { |
| 164 | 164 | } |
| 165 | 165 | |
| 166 | 166 | function renderDependantDocuments($aDependantDocumentList) { |
| 167 | - global $default, $dashboard_dependant_documents_heading; | |
| 167 | + global $default; | |
| 168 | 168 | if (count($aDependantDocumentList) > 0) { |
| 169 | 169 | $sBgColor = "#9D9D7F"; |
| 170 | 170 | } else { |
| 171 | 171 | $sBgColor = "#CECEBF"; |
| 172 | 172 | } |
| 173 | 173 | $sToRender = "\t\t\t<tr align=\"left\" bgcolor=\"$sBgColor\">\n"; |
| 174 | - $sToRender .= "\t\t\t\t<th class=\"sectionHeading\" colspan=\"2\"><font color=\"ffffff\">" . $dashboard_dependant_documents_heading . "</font></th>\n"; | |
| 174 | + $sToRender .= "\t\t\t\t<th class=\"sectionHeading\" colspan=\"2\"><font color=\"ffffff\">" . _("Dependant Documents") . "</font></th>\n"; | |
| 175 | 175 | $sToRender .= "\t\t\t</tr>\n"; |
| 176 | 176 | |
| 177 | 177 | if (count($aDependantDocumentList) > 0) { |
| ... | ... | @@ -206,9 +206,9 @@ function renderDependantDocuments($aDependantDocumentList) { |
| 206 | 206 | * Displays the quicklinks |
| 207 | 207 | */ |
| 208 | 208 | function renderQuickLinks($aQuickLinks) { |
| 209 | - global $default, $dashboard_quick_links_heading; | |
| 209 | + global $default; | |
| 210 | 210 | $sToRender .= "\t\t\t<tr align=\"left\" bgcolor=\"#9D9D7F\">\n"; |
| 211 | - $sToRender .= "\t\t\t\t<th class=\"sectionHeading\"><font color=\"ffffff\">" . $dashboard_quick_links_heading . "</font></th>\n"; | |
| 211 | + $sToRender .= "\t\t\t\t<th class=\"sectionHeading\"><font color=\"ffffff\">" . _("Quick Links") . "</font></th>\n"; | |
| 212 | 212 | $sToRender .= "\t\t\t</tr>\n"; |
| 213 | 213 | for ($i = 0; $i < count($aQuickLinks); $i++) { |
| 214 | 214 | $sToRender .= "\t\t\t<tr>\n"; |
| ... | ... | @@ -260,7 +260,7 @@ function renderDashboardNews() { |
| 260 | 260 | |
| 261 | 261 | return $sToRender; |
| 262 | 262 | } |
| 263 | - | |
| 263 | + | |
| 264 | 264 | /** |
| 265 | 265 | * Renders the dashboard |
| 266 | 266 | * |
| ... | ... | @@ -269,16 +269,18 @@ function renderDashboardNews() { |
| 269 | 269 | * @param array subscription alerts for this user |
| 270 | 270 | */ |
| 271 | 271 | function renderPage($aPendingDocumentList, $aCheckedOutDocumentList, $aSubscriptionAlertList, $aQuickLinks, $aWebDocuments, $aDependantDocuments, $aRestorationRequests) { |
| 272 | - global $default, $dashboard_welcome; | |
| 272 | + global $default; | |
| 273 | 273 | |
| 274 | 274 | $sToRender = "<table border=\"0\" width=\"600\" >\n"; |
| 275 | 275 | $sToRender .= "\t<tr valign=\"top\">\n"; |
| 276 | - $sToRender .= "\t\t<td><img src=\"$default->graphicsUrl/welcome.gif\" border=\"0\"/></td>\n"; | |
| 276 | + $sToRender .= "\t\t<td><img src=\"" . imgSrc("welcome.gif") . "\" border=\"0\"/></td>\n"; | |
| 277 | 277 | |
| 278 | 278 | // some arb welcoming text goes here |
| 279 | 279 | $oUser = & User::get($_SESSION["userID"]); |
| 280 | - $sUserName = $oUser->getName(); | |
| 281 | - $sToRender .= "\t\t<td>" . getTranslatedString($dashboard_welcome, array(0 => (strlen($sUserName) > 0 ? " " . $sUserName : ""), 1 => lookupField($default->organisations_table, "name", "id", $default->organisationID))) . "</td>\n"; | |
| 280 | + $sUserName = $oUser->getName(); | |
| 281 | + $sToRender .= "\t\t<td>" . sprintf(_('Hi %1$s, welcome back to the %2$s DMS, part of the Knowledge Tree'), | |
| 282 | + (strlen($sUserName) > 0 ? " " . $sUserName : ""), | |
| 283 | + lookupField($default->organisations_table, "name", "id", $default->organisationID)) . "</td>\n"; | |
| 282 | 284 | |
| 283 | 285 | // dashboard news |
| 284 | 286 | $sToRender .= "\t\t<td>\n"; | ... | ... |
presentation/lookAndFeel/knowledgeTree/documentmanagement/browseUI.inc
| ... | ... | @@ -37,15 +37,14 @@ require_once("$default->uiDirectory/foldermanagement/addFolderUI.inc"); |
| 37 | 37 | * @param string the selected browse by option |
| 38 | 38 | */ |
| 39 | 39 | function renderBrowseTypeSelect($sBrowseType) { |
| 40 | - global $browse_view_documents_by_heading, $browse_view_documents_by_folder, $browse_view_documents_by_category, $browse_view_documents_by_doctype; | |
| 41 | 40 | // TODO: write function for onChange that checks if the new value |
| 42 | 41 | return "<span class=\"browseTypeSelect\">\n |
| 43 | - \t" . $browse_view_documents_by_heading . ": <input type=\"radio\" name=\"fBrowseType\" onclick=\"document.MainForm.submit()\" value=\"folder\"" . | |
| 44 | - ((($sBrowseType=="folder") || (strlen($sBrowseType)==0)) ? " checked=\"checked\"" : "") . "/> " . $browse_view_documents_by_folder ."\n" . | |
| 42 | + \t" . _("View documents by") . ": <input type=\"radio\" name=\"fBrowseType\" onclick=\"document.MainForm.submit()\" value=\"folder\"" . | |
| 43 | + ((($sBrowseType=="folder") || (strlen($sBrowseType)==0)) ? " checked=\"checked\"" : "") . "/> " . _("Folders") ."\n" . | |
| 45 | 44 | "<input type=\"radio\" name=\"fBrowseType\" onclick=\"document.MainForm.submit()\" value=\"category\"" . |
| 46 | - (($sBrowseType=="category") ? " checked=\"checked\"" : "") . "/> " . $browse_view_documents_by_category . "\n" . | |
| 45 | + (($sBrowseType=="category") ? " checked=\"checked\"" : "") . "/> " . _("Category") . "\n" . | |
| 47 | 46 | "<input type=\"radio\" name=\"fBrowseType\" onclick=\"document.MainForm.submit()\" value=\"documentType\"" . |
| 48 | - (($sBrowseType=="documentType") ? " checked=\"checked\"" : "") . "/> " . $browse_view_documents_by_doctype . "\n</span>"; | |
| 47 | + (($sBrowseType=="documentType") ? " checked=\"checked\"" : "") . "/> " . _("Document Type") . "\n</span>"; | |
| 49 | 48 | } |
| 50 | 49 | |
| 51 | 50 | // <category browse helper methods> |
| ... | ... | @@ -193,7 +192,7 @@ function renderDocumentTypeResults($aResults) { |
| 193 | 192 | * @param array the browse result objects |
| 194 | 193 | */ |
| 195 | 194 | function renderFolderResults($aResults, $bTemplateBrowsing = false) { |
| 196 | - global $default, $browse_no_sub_folders, $browse_no_documents, $browse_no_document_permission; | |
| 195 | + global $default; | |
| 197 | 196 | $sToRender = ""; |
| 198 | 197 | |
| 199 | 198 | // now loop through the rest of the folders and display links |
| ... | ... | @@ -217,10 +216,13 @@ function renderFolderResults($aResults, $bTemplateBrowsing = false) { |
| 217 | 216 | $sToRender .= "</tr>\n"; |
| 218 | 217 | } |
| 219 | 218 | } else { |
| 220 | - $sToRender .= "<tr><td colspan=\"5\">" . $browse_no_sub_folders . "</td></tr>"; | |
| 219 | + $sToRender .= "<tr><td colspan=\"5\">" . _("This folder contains no sub folders") . "</td></tr>"; | |
| 221 | 220 | } |
| 222 | 221 | |
| 223 | - $sToRender .= "<tr><td>" . renderDocumentList($aResults, $browse_no_documents, $browse_no_document_permission, false, $bTemplateBrowsing) . "</td></tr>\n"; | |
| 222 | + $sToRender .= "<tr><td>" . renderDocumentList($aResults, _("This folder contains no documents"), | |
| 223 | + _("You don't have access to the documents in this folder"), | |
| 224 | + false, $bTemplateBrowsing) . | |
| 225 | + "</td></tr>\n"; | |
| 224 | 226 | |
| 225 | 227 | return $sToRender; |
| 226 | 228 | } |
| ... | ... | @@ -332,12 +334,12 @@ function appendCounts($aFolderPath, $iFolderCount, $iDocumentCount) { |
| 332 | 334 | */ |
| 333 | 335 | |
| 334 | 336 | function renderPage($aResults, $sBrowseType, $sSortBy, $sSortDirection, $bTemplateBrowsing = false) { |
| 335 | - global $default, $browse_collection_heading; | |
| 337 | + global $default; | |
| 336 | 338 | |
| 337 | 339 | $sSectionName = $default->siteMap->getSectionName(substr($_SERVER["PHP_SELF"], strlen($default->rootUrl), strlen($_SERVER["PHP_SELF"]))); |
| 338 | 340 | $sTDBGColour = $default->siteMap->getSectionColour($sSectionName, "td"); |
| 339 | 341 | |
| 340 | - $sToRender = renderHeading($browse_collection_heading); | |
| 342 | + $sToRender = renderHeading(_("Browse collection")); | |
| 341 | 343 | |
| 342 | 344 | $sToRender .= "<table border=\"0\" cellpadding=\"5\" width=\"100%\"><tr><td bgcolor=\"$sTDBGColour\">"; |
| 343 | 345 | switch ($sBrowseType) { | ... | ... |