mirror of
https://github.com/nextcloud/server.git
synced 2026-04-27 01:00:20 -04:00
l10n support enhanced in files_version
This commit is contained in:
parent
0efcf33e2f
commit
488ab0dba2
3 changed files with 16 additions and 8 deletions
|
|
@ -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", $file ))));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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') );
|
||||
|
||||
$tmpl->assign( 'outcome_msg', "File {$_GET['path']} could not be reverted to version ".OCP\Util::formatDate( doubleval($_GET['revert']) ) );
|
||||
$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', $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') );
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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 ' ';
|
||||
|
|
|
|||
Loading…
Reference in a new issue