Skip to content
Snippets Groups Projects
Commit 9909b8b7 authored by Thomas Müller's avatar Thomas Müller
Browse files

adding translations to update events

parent 7d141656
No related branches found
No related tags found
No related merge requests found
......@@ -4,25 +4,26 @@ $RUNTIME_NOAPPS = true;
require_once '../../lib/base.php';
if (OC::checkUpgrade(false)) {
$l = new \OC_L10N('core');
$eventSource = new OC_EventSource();
$updater = new \OC\Updater(\OC_Log::$object);
$updater->listen('\OC\Updater', 'maintenanceStart', function () use ($eventSource) {
$eventSource->send('success', 'Turned on maintenance mode');
$updater->listen('\OC\Updater', 'maintenanceStart', function () use ($eventSource, $l) {
$eventSource->send('success', (string)$l->t('Turned on maintenance mode'));
});
$updater->listen('\OC\Updater', 'maintenanceEnd', function () use ($eventSource) {
$eventSource->send('success', 'Turned off maintenance mode');
$updater->listen('\OC\Updater', 'maintenanceEnd', function () use ($eventSource, $l) {
$eventSource->send('success', (string)$l->t('Turned off maintenance mode'));
});
$updater->listen('\OC\Updater', 'dbUpgrade', function () use ($eventSource) {
$eventSource->send('success', 'Updated database');
$updater->listen('\OC\Updater', 'dbUpgrade', function () use ($eventSource, $l) {
$eventSource->send('success', (string)$l->t('Updated database'));
});
$updater->listen('\OC\Updater', 'filecacheStart', function () use ($eventSource) {
$eventSource->send('success', 'Updating filecache, this may take really long...');
$updater->listen('\OC\Updater', 'filecacheStart', function () use ($eventSource, $l) {
$eventSource->send('success', (string)$l->t('Updating filecache, this may take really long...'));
});
$updater->listen('\OC\Updater', 'filecacheDone', function () use ($eventSource) {
$eventSource->send('success', 'Updated filecache');
$updater->listen('\OC\Updater', 'filecacheDone', function () use ($eventSource, $l) {
$eventSource->send('success', (string)$l->t('Updated filecache'));
});
$updater->listen('\OC\Updater', 'filecacheProgress', function ($out) use ($eventSource) {
$eventSource->send('success', '... ' . $out . '% done ...');
$updater->listen('\OC\Updater', 'filecacheProgress', function ($out) use ($eventSource, $l) {
$eventSource->send('success', (string)$l->t('... %d%% done ...', array('percent' => $out)));
});
$updater->listen('\OC\Updater', 'failure', function ($message) use ($eventSource) {
$eventSource->send('failure', $message);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment