mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-16 01:24:38 +00:00
Merge pull request #469 from thelinuxfr/master
Firmware update, proposed addition of missing translations
This commit is contained in:
commit
311a9bfd2e
@ -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;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user