Commit 395228f3 authored by Frédéric LIETART (TheLinuxFr)'s avatar Frédéric LIETART (TheLinuxFr) Committed by Franco Fichtner

Firmware update, proposed addition of missing translations

(cherry picked from commit 98678fb1)
(cherry picked from commit b06e42ae)
(cherry picked from commit 26708b04)
parent 465f4bc4
......@@ -51,40 +51,42 @@ class FirmwareController extends ApiControllerBase
if ($response != null) {
if (array_key_exists('connection', $response) && $response['connection'] == 'error') {
$response['status_msg'] = 'Connection error.';
$response['status_msg'] = gettext('Connection error.');
$response['status'] = 'error';
} elseif (array_key_exists('repository', $response) && $response['repository'] == 'error') {
$response['status_msg'] = 'Repository problem.';
$response['status_msg'] = gettext('Repository problem.');
$response['status'] = 'error';
} elseif (array_key_exists('updates', $response) && $response['updates'] == 0) {
$response['status_msg'] = 'There are no updates available.';
$response['status_msg'] = gettext('There are no updates available.');
$response['status'] = 'none';
} elseif (array_key_exists(0, $response['upgrade_packages']) &&
$response['upgrade_packages'][0]['name'] == 'pkg') {
$response['status_upgrade_action'] = 'pkg';
$response['status'] = 'ok';
$response['status_msg'] =
'There is a mandatory update for the package manager available. ' .
'Please install and fetch updates again.';
gettext(
'There is a mandatory update for the package manager available. ' .
'Please install and fetch updates again.'
);
} elseif (array_key_exists('updates', $response)) {
$response['status_upgrade_action'] = 'all';
$response['status'] = 'ok';
if ($response['updates'] == 1) {
/* keep this dynamic for template translation even though %s is always '1' */
$response['status_msg'] = sprintf('There is %s update available.', $response['updates']);
$response['status_msg'] = sprintf(gettext('There is %s update available.'), $response['updates']);
} else {
$response['status_msg'] = sprintf('There are %s updates available.', $response['updates']);
$response['status_msg'] = sprintf(gettext('There are %s updates available.'), $response['updates']);
}
if ($response['upgrade_needs_reboot'] == 1) {
$response['status_msg'] = sprintf(
'%s %s',
$response['status_msg'],
'This update requires a reboot.'
gettext('This update requires a reboot.')
);
}
}
} else {
$response = array('status' => 'unknown', 'status_msg' => 'Current status is unknown.');
$response = array('status' => 'unknown', 'status_msg' => gettext('Current status is unknown.'));
}
return $response;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment