diff options
author | Lukas Reschke <lukas@statuscode.ch> | 2013-02-07 12:38:36 -0800 |
---|---|---|
committer | Lukas Reschke <lukas@statuscode.ch> | 2013-02-07 12:38:36 -0800 |
commit | c0154558c7b29bbd55b099f9fcab8ed6c0b108ef (patch) | |
tree | 0e6e983c4e735869373ce6af439dc10783d0f57d | |
parent | fc7230349b6028184b21b229ef5873ea8b7aa99a (diff) | |
parent | 5f92d269dc83762bbf200158149eec1e605c98a6 (diff) | |
download | nextcloud-server-c0154558c7b29bbd55b099f9fcab8ed6c0b108ef.tar.gz nextcloud-server-c0154558c7b29bbd55b099f9fcab8ed6c0b108ef.zip |
Merge pull request #1526 from owncloud/l10n-support-master
L10n support master
-rw-r--r-- | apps/files_trashbin/ajax/delete.php | 3 | ||||
-rw-r--r-- | apps/files_trashbin/ajax/undelete.php | 6 | ||||
-rw-r--r-- | apps/files_versions/ajax/rollbackVersion.php | 3 | ||||
-rw-r--r-- | apps/files_versions/history.php | 19 | ||||
-rw-r--r-- | apps/files_versions/templates/history.php | 2 | ||||
-rw-r--r-- | core/ajax/vcategories/add.php | 2 | ||||
-rw-r--r-- | core/ajax/vcategories/removeFromFavorites.php | 4 |
7 files changed, 25 insertions, 14 deletions
diff --git a/apps/files_trashbin/ajax/delete.php b/apps/files_trashbin/ajax/delete.php index 7ea0155724f..7a6bd1342ea 100644 --- a/apps/files_trashbin/ajax/delete.php +++ b/apps/files_trashbin/ajax/delete.php @@ -18,6 +18,7 @@ if ($path_parts['dirname'] == '.') { if (OCA\Files_Trashbin\Trashbin::delete($filename, $timestamp)) { OCP\JSON::success(array("data" => array("filename" => $file))); } else { - OCP\JSON::error(array("data" => array("message" => "Couldn't delete ".$file. " permanently"))); + $l = OC_L10N::get('files_trashbin'); + OCP\JSON::error(array("data" => array("message" => $l->t("Couldn't delete %s permanently", array($file))))); } diff --git a/apps/files_trashbin/ajax/undelete.php b/apps/files_trashbin/ajax/undelete.php index a118d003de7..cc010979c51 100644 --- a/apps/files_trashbin/ajax/undelete.php +++ b/apps/files_trashbin/ajax/undelete.php @@ -37,8 +37,10 @@ if ( $error ) { foreach ( $error as $e ) { $filelist .= $e.', '; } - OCP\JSON::error(array("data" => array("message" => "Couldn't restore ".rtrim($filelist,', '), "success" => $success, "error" => $error))); + $l = OC_L10N::get('files_trashbin'); + $message = $l->t("Couldn't restore %s", array(rtrim($filelist,', '))); + OCP\JSON::error(array("data" => array("message" => $message, + "success" => $success, "error" => $error))); } else { OCP\JSON::success(array("data" => array("success" => $success))); } - diff --git a/apps/files_versions/ajax/rollbackVersion.php b/apps/files_versions/ajax/rollbackVersion.php index dc5a59cb4af..2970915ac63 100644 --- a/apps/files_versions/ajax/rollbackVersion.php +++ b/apps/files_versions/ajax/rollbackVersion.php @@ -11,6 +11,7 @@ $revision=(int)$_GET['revision']; if(OCA\Files_Versions\Storage::rollback( $file, $revision )) { OCP\JSON::success(array("data" => array( "revision" => $revision, "file" => $file ))); }else{ - OCP\JSON::error(array("data" => array( "message" => "Could not revert:" . $file ))); + $l = OC_L10N::get('files_versions'); + OCP\JSON::error(array("data" => array( "message" => $l->t("Could not revert: %s", array($file) )))); } diff --git a/apps/files_versions/history.php b/apps/files_versions/history.php index 1bd5cde44be..437a3fec065 100644 --- a/apps/files_versions/history.php +++ b/apps/files_versions/history.php @@ -24,6 +24,7 @@ OCP\User::checkLoggedIn( ); OCP\Util::addStyle('files_versions', 'versions'); $tmpl = new OCP\Template( 'files_versions', 'history', 'user' ); +$l = OC_L10N::get('files_versions'); if ( isset( $_GET['path'] ) ) { @@ -36,15 +37,21 @@ if ( isset( $_GET['path'] ) ) { if( $versions->rollback( $path, $_GET['revert'] ) ) { - $tmpl->assign( 'outcome_stat', 'success' ); + $tmpl->assign( 'outcome_stat', $l->t('success') ); - $tmpl->assign( 'outcome_msg', "File {$_GET['path']} was reverted to version ".OCP\Util::formatDate( doubleval($_GET['revert']) ) ); + $message = $l->t('File %s was reverted to version %s', + array($_GET['path'], OCP\Util::formatDate( doubleval($_GET['revert']) ) ) ); + + $tmpl->assign( 'outcome_msg', $message); } else { - $tmpl->assign( 'outcome_stat', 'failure' ); + $tmpl->assign( 'outcome_stat', $l->t('failure') ); + + $message = $l->t('File %s could not be reverted to version %s', + array($_GET['path'], OCP\Util::formatDate( doubleval($_GET['revert']) ) ) ); - $tmpl->assign( 'outcome_msg', "File {$_GET['path']} could not be reverted to version ".OCP\Util::formatDate( doubleval($_GET['revert']) ) ); + $tmpl->assign( 'outcome_msg', $message); } @@ -58,12 +65,12 @@ if ( isset( $_GET['path'] ) ) { }else{ - $tmpl->assign( 'message', 'No old versions available' ); + $tmpl->assign( 'message', $l->t('No old versions available') ); } }else{ - $tmpl->assign( 'message', 'No path specified' ); + $tmpl->assign( 'message', $l->t('No path specified') ); } diff --git a/apps/files_versions/templates/history.php b/apps/files_versions/templates/history.php index cc5a494f19e..850ece89c98 100644 --- a/apps/files_versions/templates/history.php +++ b/apps/files_versions/templates/history.php @@ -17,7 +17,7 @@ if( isset( $_['message'] ) ) { } echo( '<strong>Versions of '.$_['path'] ).'</strong><br>'; - echo('<p><em>Revert a file to a previous version by clicking on its revert button</em></p><br />'); + echo('<p><em>'.$l->t('Revert a file to a previous version by clicking on its revert button').'</em></p><br />'); foreach ( $_['versions'] as $v ) { echo ' '; diff --git a/core/ajax/vcategories/add.php b/core/ajax/vcategories/add.php index 23d00af70ab..16a1461be08 100644 --- a/core/ajax/vcategories/add.php +++ b/core/ajax/vcategories/add.php @@ -34,7 +34,7 @@ debug(print_r($category, true)); $categories = new OC_VCategories($type); if($categories->hasCategory($category)) { - bailOut(OC_Contacts_App::$l10n->t('This category already exists: '.$category)); + bailOut($l->t('This category already exists: %s', array($category))); } else { $categories->add($category, true); } diff --git a/core/ajax/vcategories/removeFromFavorites.php b/core/ajax/vcategories/removeFromFavorites.php index ba6e95c2497..78a528caa86 100644 --- a/core/ajax/vcategories/removeFromFavorites.php +++ b/core/ajax/vcategories/removeFromFavorites.php @@ -27,12 +27,12 @@ if(is_null($type)) { } if(is_null($id)) { - bailOut($l->t('%s ID not provided.', $type)); + bailOut($l->t('%s ID not provided.', array($type))); } $categories = new OC_VCategories($type); if(!$categories->removeFromFavorites($id, $type)) { - bailOut($l->t('Error removing %s from favorites.', $id)); + bailOut($l->t('Error removing %s from favorites.', array($id))); } OC_JSON::success(); |