diff --git a/bin/genpo.sh b/bin/genpo.sh index 1592ec8..3426a7a 100755 --- a/bin/genpo.sh +++ b/bin/genpo.sh @@ -9,5 +9,5 @@ rm -f i18n/templates.c find resources -name "*.js" | sort | python ./bin/jsi18n.py > templates/ktcore/javascript_i18n.smarty php bin/smarty_to_gettext.php . > i18n/templates.c find . -type f -name "*.php" -o -name "*.inc" | sort | xgettext --no-wrap -d knowledgeTree -L PHP -s -f - --keyword=_kt -o i18n/knowledgeTree.pot -echo i18n/templates.c i18n/permissions.c | xargs -n 1 | sort | xgettext --no-wrap -d knowledgeTree -j -s -f - -o i18n/knowledgeTree.pot +echo i18n/templates.c i18n/transactions.c i18n/permissions.c | xargs -n 1 | sort | xgettext --no-wrap -d knowledgeTree -j -s -f - -o i18n/knowledgeTree.pot diff --git a/i18n/transactions.c b/i18n/transactions.c index 6111fd5..b038fe3 100644 --- a/i18n/transactions.c +++ b/i18n/transactions.c @@ -1,19 +1,19 @@ -gettext('Create'); -gettext('Update'); -gettext('Delete'); -gettext('Rename'); -gettext('Move'); -gettext('Download'); -gettext('Check In'); -gettext('Check Out'); -gettext('Collaboration Step Rollback'); -gettext('View'); -gettext('Expunge'); -gettext('Force CheckIn'); -gettext('Email Link'); -gettext('Collaboration Step Approve'); -gettext('Email Attachment'); -gettext('Workflow state transition'); -gettext('Permissions changed'); -gettext('Role allocations changed'); -gettext('Bulk Export'); +gettext("Create"); +gettext("Update"); +gettext("Delete"); +gettext("Rename"); +gettext("Move"); +gettext("Download"); +gettext("Check In"); +gettext("Check Out"); +gettext("Collaboration Step Rollback"); +gettext("View"); +gettext("Expunge"); +gettext("Force CheckIn"); +gettext("Email Link"); +gettext("Collaboration Step Approve"); +gettext("Email Attachment"); +gettext("Workflow state transition"); +gettext("Permissions changed"); +gettext("Role allocations changed"); +gettext("Bulk Export"); diff --git a/lib/documentmanagement/documentutil.inc.php b/lib/documentmanagement/documentutil.inc.php index ed99e68..c1656a0 100644 --- a/lib/documentmanagement/documentutil.inc.php +++ b/lib/documentmanagement/documentutil.inc.php @@ -494,7 +494,7 @@ class KTDocumentUtil { // $oUploadChannel->sendMessage(new KTUploadGenericMessage(_kt("Creating transaction"))); $aOptions = array('user' => $oUser); //create the document transaction record - $oDocumentTransaction = & new DocumentTransaction($oDocument, "Document created", 'ktcore.transactions.create', $aOptions); + $oDocumentTransaction = & new DocumentTransaction($oDocument, _kt('Document created'), 'ktcore.transactions.create', $aOptions); $res = $oDocumentTransaction->create(); if (PEAR::isError($res)) { $oDocument->delete(); @@ -711,7 +711,7 @@ class KTDocumentUtil { return PEAR::raiseError(_kt("There was a problem deleting the document from storage.")); } - $oDocumentTransaction = & new DocumentTransaction($oDocument, "Document deleted: " . $sReason, 'ktcore.transactions.delete'); + $oDocumentTransaction = & new DocumentTransaction($oDocument, _kt('Document deleted: ') . $sReason, 'ktcore.transactions.delete'); $oDocumentTransaction->create(); $oDocument->setFolderID(1); @@ -863,11 +863,11 @@ class KTDocumentUtil { } - $oDocumentTransaction = & new DocumentTransaction($oDocument, sprintf("Copied to folder \"%s\". %s", $oDestinationFolder->getName(), $sReason), 'ktcore.transactions.copy'); + $oDocumentTransaction = & new DocumentTransaction($oDocument, sprintf(_kt("Copied to folder \"%s\". %s"), $oDestinationFolder->getName(), $sReason), 'ktcore.transactions.copy'); $oDocumentTransaction->create(); $oSrcFolder = Folder::get($oDocument->getFolderID()); - $oDocumentTransaction = & new DocumentTransaction($oNewDocument, sprintf("Copied from original in folder \"%s\". %s", $oSrcFolder->getName(), $sReason), 'ktcore.transactions.copy'); + $oDocumentTransaction = & new DocumentTransaction($oNewDocument, sprintf(_kt("Copied from original in folder \"%s\". %s"), $oSrcFolder->getName(), $sReason), 'ktcore.transactions.copy'); $oDocumentTransaction->create(); return $oNewDocument; @@ -902,7 +902,7 @@ class KTDocumentUtil { } // create the document transaction record - $oDocumentTransaction = & new DocumentTransaction($oDocument, 'Document renamed', 'ktcore.transactions.update'); + $oDocumentTransaction = & new DocumentTransaction($oDocument, _kt('Document renamed'), 'ktcore.transactions.update'); $oDocumentTransaction->create(); // fire subscription alerts for the checked in document @@ -945,7 +945,7 @@ class KTDocumentUtil { return $res; // we failed, bail. } - $sMoveMessage = sprintf("Moved from %s/%s to %s/%s. %s", + $sMoveMessage = sprintf(_kt("Moved from %s/%s to %s/%s. %s"), $oOriginalFolder->getFullPath(), $oOriginalFolder->getName(), $oFolder->getFullPath(), diff --git a/lib/foldermanagement/folderutil.inc.php b/lib/foldermanagement/folderutil.inc.php index c45db7f..0c4e49f 100644 --- a/lib/foldermanagement/folderutil.inc.php +++ b/lib/foldermanagement/folderutil.inc.php @@ -78,7 +78,7 @@ class KTFolderUtil { $oTransaction = KTFolderTransaction::createFromArray(array( 'folderid' => $oFolder->getId(), - 'comment' => "Folder created", + 'comment' => _kt('Folder created'), 'transactionNS' => 'ktcore.transactions.create', 'userid' => $oUser->getId(), 'ip' => Session::getClientIP(), @@ -266,7 +266,7 @@ class KTFolderUtil { $oTransaction = KTFolderTransaction::createFromArray(array( 'folderid' => $oFolder->getId(), - 'comment' => sprintf("Renamed from \"%s\" to \"%s\"", $sOldName, $sNewName), + 'comment' => sprintf(_kt("Renamed from \"%s\" to \"%s\""), $sOldName, $sNewName), 'transactionNS' => 'ktcore.transactions.rename', 'userid' => $_SESSION['userID'], 'ip' => Session::getClientIP(), diff --git a/lib/workflow/workflowutil.inc.php b/lib/workflow/workflowutil.inc.php index b30341f..8dedeef 100644 --- a/lib/workflow/workflowutil.inc.php +++ b/lib/workflow/workflowutil.inc.php @@ -163,12 +163,12 @@ class KTWorkflowUtil { $oDocument->setWorkflowId($iWorkflowId); $oDocument->setWorkflowStateId($iStartStateId); - $sTransactionComments = "Workflow \"" . $oWorkflow->getHumanName() . "\" started."; + $sTransactionComments = sprintf(_kt("Workflow \"%s\" started."), $oWorkflow->getHumanName()); } else { $oDocument->setWorkflowId(null); $oDocument->setWorkflowStateId(null); - $sTransactionComments = "Workflow removed from document."; + $sTransactionComments = _kt('Workflow removed from document.'); } $res = $oDocument->update(); @@ -578,9 +578,10 @@ class KTWorkflowUtil { $sTargetState = $oTargetState->getName(); // create the document transaction record - $sTransactionComments = "Workflow state changed from $sSourceState to $sTargetState"; + $sTransactionComments = sprintf(_kt("Workflow state changed from %s to %s"), $sSourceState, $sTargetState); + if ($sComments) { - $sTransactionComments .= "; Reason given was: " . $sComments; + $sTransactionComments .= _kt("; Reason given was: ") . $sComments; } $oDocumentTransaction = & new DocumentTransaction($oDocument, $sTransactionComments, 'ktcore.transactions.workflow_state_transition'); $oDocumentTransaction->create(); diff --git a/plugins/ktcore/KTDocumentActions.php b/plugins/ktcore/KTDocumentActions.php index cab5a24..ed35060 100644 --- a/plugins/ktcore/KTDocumentActions.php +++ b/plugins/ktcore/KTDocumentActions.php @@ -230,7 +230,7 @@ class KTDocumentViewAction extends KTDocumentAction { exit(0); } - $oDocumentTransaction = & new DocumentTransaction($this->oDocument, 'Document downloaded', 'ktcore.transactions.download', $aOptions); + $oDocumentTransaction = & new DocumentTransaction($this->oDocument, _kt('Document downloaded'), 'ktcore.transactions.download', $aOptions); $oDocumentTransaction->create(); exit(0); } diff --git a/plugins/ktcore/KTPermissions.php b/plugins/ktcore/KTPermissions.php index 4ce91a5..3dae13d 100644 --- a/plugins/ktcore/KTPermissions.php +++ b/plugins/ktcore/KTPermissions.php @@ -417,7 +417,7 @@ class KTRoleAllocationPlugin extends KTFolderAction { $oTransaction = KTFolderTransaction::createFromArray(array( 'folderid' => $this->oFolder->getId(), - 'comment' => "Override parent allocation", + 'comment' => _kt('Override parent allocation'), 'transactionNS' => 'ktcore.transactions.role_allocations_change', 'userid' => $_SESSION['userID'], 'ip' => Session::getClientIP(), @@ -457,7 +457,7 @@ class KTRoleAllocationPlugin extends KTFolderAction { $oTransaction = KTFolderTransaction::createFromArray(array( 'folderid' => $this->oFolder->getId(), - 'comment' => "Use parent allocation", + 'comment' => _kt('Use parent allocation'), 'transactionNS' => 'ktcore.transactions.role_allocations_change', 'userid' => $_SESSION['userID'], 'ip' => Session::getClientIP(), @@ -640,7 +640,7 @@ class KTRoleAllocationPlugin extends KTFolderAction { $oTransaction = KTFolderTransaction::createFromArray(array( 'folderid' => $this->oFolder->getId(), - 'comment' => "Set role users", + 'comment' => _kt('Set role users'), 'transactionNS' => 'ktcore.transactions.role_allocations_change', 'userid' => $_SESSION['userID'], 'ip' => Session::getClientIP(), @@ -695,7 +695,7 @@ class KTRoleAllocationPlugin extends KTFolderAction { $oTransaction = KTFolderTransaction::createFromArray(array( 'folderid' => $this->oFolder->getId(), - 'comment' => "Set role groups", + 'comment' => _kt('Set role groups'), 'transactionNS' => 'ktcore.transactions.role_allocations_change', 'userid' => $_SESSION['userID'], 'ip' => Session::getClientIP(), diff --git a/plugins/ktcore/admin/deletedDocuments.php b/plugins/ktcore/admin/deletedDocuments.php index 20c0267..475913b 100755 --- a/plugins/ktcore/admin/deletedDocuments.php +++ b/plugins/ktcore/admin/deletedDocuments.php @@ -241,7 +241,7 @@ var $sHelpPage = 'ktcore/admin/deleted documents.html'; // create a doc-transaction. // FIXME does this warrant a transaction-type? - $oTransaction = new DocumentTransaction($oDoc, 'Restored from deleted state by ' . $this->oUser->getName(), 'ktcore.transactions.update'); + $oTransaction = new DocumentTransaction($oDoc, _kt('Restored from deleted state by ') . $this->oUser->getName(), 'ktcore.transactions.update'); if (!$oTransaction->create()) { ; // do nothing? the state of physicaldocumentmanager... } diff --git a/plugins/ktcore/admin/documentCheckout.php b/plugins/ktcore/admin/documentCheckout.php index ad9aea8..584242f 100644 --- a/plugins/ktcore/admin/documentCheckout.php +++ b/plugins/ktcore/admin/documentCheckout.php @@ -112,7 +112,7 @@ class KTCheckoutAdminDispatcher extends KTAdminDispatcher { } // checkout cancelled transaction - $oDocumentTransaction = & new DocumentTransaction($oDocument, "Document checked out cancelled", 'ktcore.transactions.force_checkin'); + $oDocumentTransaction = & new DocumentTransaction($oDocument, _kt('Document checked out cancelled'), 'ktcore.transactions.force_checkin'); $res = $oDocumentTransaction->create(); if (PEAR::isError($res) || ($res == false)) { $this->rollbackTransaction(); diff --git a/plugins/ktcore/folder/Permissions.php b/plugins/ktcore/folder/Permissions.php index aef4f7f..d1a631a 100644 --- a/plugins/ktcore/folder/Permissions.php +++ b/plugins/ktcore/folder/Permissions.php @@ -233,7 +233,7 @@ class KTFolderPermissionsAction extends KTFolderAction { function _copyPermissions() { $oTransaction = KTFolderTransaction::createFromArray(array( 'folderid' => $this->oFolder->getId(), - 'comment' => 'Override permissions from parent', + 'comment' => _kt('Override permissions from parent'), 'transactionNS' => 'ktcore.transactions.permissions_change', 'userid' => $_SESSION['userID'], 'ip' => Session::getClientIP(), @@ -446,7 +446,7 @@ class KTFolderPermissionsAction extends KTFolderAction { $oTransaction = KTFolderTransaction::createFromArray(array( 'folderid' => $this->oFolder->getId(), - 'comment' => 'Updated permissions', + 'comment' => _kt('Updated permissions'), 'transactionNS' => 'ktcore.transactions.permissions_change', 'userid' => $_SESSION['userID'], 'ip' => Session::getClientIP(), @@ -479,7 +479,7 @@ class KTFolderPermissionsAction extends KTFolderAction { } $oTransaction = KTFolderTransaction::createFromArray(array( 'folderid' => $this->oFolder->getId(), - 'comment' => 'Inherit permissions from parent', + 'comment' => _kt('Inherit permissions from parent'), 'transactionNS' => 'ktcore.transactions.permissions_change', 'userid' => $_SESSION['userID'], 'ip' => Session::getClientIP(), @@ -511,7 +511,7 @@ class KTFolderPermissionsAction extends KTFolderAction { $oTransaction = KTFolderTransaction::createFromArray(array( 'folderid' => $this->oFolder->getId(), - 'comment' => 'Added dynamic permissions', + 'comment' => _kt('Added dynamic permissions'), 'transactionNS' => 'ktcore.transactions.permissions_change', 'userid' => $_SESSION['userID'], 'ip' => Session::getClientIP(), @@ -548,7 +548,7 @@ class KTFolderPermissionsAction extends KTFolderAction { $oTransaction = KTFolderTransaction::createFromArray(array( 'folderid' => $this->oFolder->getId(), - 'comment' => 'Removed dynamic permissions', + 'comment' => _kt('Removed dynamic permissions'), 'transactionNS' => 'ktcore.transactions.permissions_change', 'userid' => $_SESSION['userID'], 'ip' => Session::getClientIP(), diff --git a/plugins/ktstandard/KTEmail.php b/plugins/ktstandard/KTEmail.php index fb88d5a..1736da2 100644 --- a/plugins/ktstandard/KTEmail.php +++ b/plugins/ktstandard/KTEmail.php @@ -164,7 +164,7 @@ function sendEmailDocument($sDestEmailAddress, $sDestUserName, $iDocumentID, $sD } // emailed link transaction - $oDocumentTransaction = & new DocumentTransaction($oDocument, "Document link emailed to " . $sDestEmailAddress, 'ktcore.transactions.email_attachment'); + $oDocumentTransaction = & new DocumentTransaction($oDocument, _kt('Document copy emailed to ') . $sDestEmailAddress, 'ktcore.transactions.email_attachment'); if ($oDocumentTransaction->create()) { $default->log->debug("emailBL.php created email link document transaction for document ID=$iDocumentID"); } else { @@ -219,7 +219,7 @@ function sendEmailHyperlink($sDestEmailAddress, $sDestUserName, $iDocumentID, $s // need a document to do this. $oDocument =& Document::get($iDocumentID); - $oDocumentTransaction = & new DocumentTransaction($oDocument, "Document link emailed to " . $sDestEmailAddress, 'ktcore.transactions.email_link'); + $oDocumentTransaction = & new DocumentTransaction($oDocument, _kt('Document link emailed to ') . $sDestEmailAddress, 'ktcore.transactions.email_link'); if ($oDocumentTransaction->create()) { $default->log->debug("emailBL.php created email link document transaction for document ID=$iDocumentID"); } else { diff --git a/templates/kt3/view_folder_history.smarty b/templates/kt3/view_folder_history.smarty index 1f21258..b23a5c5 100644 --- a/templates/kt3/view_folder_history.smarty +++ b/templates/kt3/view_folder_history.smarty @@ -17,7 +17,7 @@ {foreach item=aTransactionRow from=$transactions}