mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2025-11-05 04:46:03 +01:00
Go on with translations
This commit is contained in:
@@ -298,9 +298,9 @@ class AdminController
|
|||||||
|
|
||||||
$results = Cache::clearCache($clear);
|
$results = Cache::clearCache($clear);
|
||||||
if (count($results) > 0) {
|
if (count($results) > 0) {
|
||||||
$this->admin->json_response = ['status' => 'success', 'message' => 'Cache cleared <br />Method: ' . $clear . ''];
|
$this->admin->json_response = ['status' => 'success', 'message' => $this->admin->translate('PLUGIN_ADMIN.CACHE_CLEARED') . ' <br />' . $this->admin->translate('PLUGIN_ADMIN.METHOD') . ': ' . $clear . ''];
|
||||||
} else {
|
} else {
|
||||||
$this->admin->json_response = ['status' => 'error', 'message' => 'Error clearing cache'];
|
$this->admin->json_response = ['status' => 'error', 'message' => $this->admin->translate('PLUGIN_ADMIN.ERROR_CLEARING_CACHE')];
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@@ -330,7 +330,7 @@ class AdminController
|
|||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
$this->admin->json_response = [
|
$this->admin->json_response = [
|
||||||
'status' => 'error',
|
'status' => 'error',
|
||||||
'message' => 'An error occured. '. $e->getMessage()
|
'message' => $this->admin->translate('PLUGIN_ADMIN.AN_ERROR_OCCURRED') . '. '. $e->getMessage()
|
||||||
];
|
];
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@@ -347,7 +347,7 @@ class AdminController
|
|||||||
|
|
||||||
$this->admin->json_response = [
|
$this->admin->json_response = [
|
||||||
'status' => 'success',
|
'status' => 'success',
|
||||||
'message' => 'Your backup is ready for download. <a href="'.$url.'" class="button">Download backup</a>',
|
'message' => $this->admin->translate('PLUGIN_ADMIN.YOUR_BACKUP_IS_READY_FOR_DOWNLOAD') . '. <a href="'.$url.'" class="button">' . $this->admin->translate('PLUGIN_ADMIN.DOWNLOAD_BACKUP') .'</a>',
|
||||||
'toastr' => [
|
'toastr' => [
|
||||||
'timeOut' => 0,
|
'timeOut' => 0,
|
||||||
'closeButton' => true
|
'closeButton' => true
|
||||||
@@ -404,7 +404,7 @@ class AdminController
|
|||||||
|
|
||||||
$this->admin->json_response = [
|
$this->admin->json_response = [
|
||||||
'status' => 'success',
|
'status' => 'success',
|
||||||
'message' => 'Pages filtered',
|
'message' => $this->admin->translate('PLUGIN_ADMIN.PAGES_FILTERED'),
|
||||||
'results' => $results
|
'results' => $results
|
||||||
];
|
];
|
||||||
$this->admin->collection = $collection;
|
$this->admin->collection = $collection;
|
||||||
@@ -424,7 +424,7 @@ class AdminController
|
|||||||
$page = $this->admin->page(true);
|
$page = $this->admin->page(true);
|
||||||
|
|
||||||
if (!$page) {
|
if (!$page) {
|
||||||
$this->admin->json_response = ['status' => 'error', 'message' => 'No Page found'];
|
$this->admin->json_response = ['status' => 'error', 'message' => $this->admin->translate('PLUGIN_ADMIN.NO_PAGE_FOUND')];
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -452,7 +452,7 @@ class AdminController
|
|||||||
$config = $this->grav['config'];
|
$config = $this->grav['config'];
|
||||||
|
|
||||||
if (!isset($_FILES['file']['error']) || is_array($_FILES['file']['error'])) {
|
if (!isset($_FILES['file']['error']) || is_array($_FILES['file']['error'])) {
|
||||||
$this->admin->json_response = ['status' => 'error', 'message' => 'Invalid Parameters'];
|
$this->admin->json_response = ['status' => 'error', 'message' => $this->admin->translate('PLUGIN_ADMIN.INVALID_PARAMETERS')];
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -461,21 +461,21 @@ class AdminController
|
|||||||
case UPLOAD_ERR_OK:
|
case UPLOAD_ERR_OK:
|
||||||
break;
|
break;
|
||||||
case UPLOAD_ERR_NO_FILE:
|
case UPLOAD_ERR_NO_FILE:
|
||||||
$this->admin->json_response = ['status' => 'error', 'message' => 'No files sent'];
|
$this->admin->json_response = ['status' => 'error', 'message' => $this->admin->translate('PLUGIN_ADMIN.NO_FILES_SENT')];
|
||||||
return;
|
return;
|
||||||
case UPLOAD_ERR_INI_SIZE:
|
case UPLOAD_ERR_INI_SIZE:
|
||||||
case UPLOAD_ERR_FORM_SIZE:
|
case UPLOAD_ERR_FORM_SIZE:
|
||||||
$this->admin->json_response = ['status' => 'error', 'message' => 'Exceeded filesize limit.'];
|
$this->admin->json_response = ['status' => 'error', 'message' => $this->admin->translate('PLUGIN_ADMIN.EXCEEDED_FILESIZE_LIMIT')];
|
||||||
return;
|
return;
|
||||||
default:
|
default:
|
||||||
$this->admin->json_response = ['status' => 'error', 'message' => 'Unkown errors'];
|
$this->admin->json_response = ['status' => 'error', 'message' => $this->admin->translate('PLUGIN_ADMIN.UNKNOWN_ERRORS')];
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$grav_limit = $config->get('system.media.upload_limit', 0);
|
$grav_limit = $config->get('system.media.upload_limit', 0);
|
||||||
// You should also check filesize here.
|
// You should also check filesize here.
|
||||||
if ($grav_limit > 0 && $_FILES['file']['size'] > grav_limit) {
|
if ($grav_limit > 0 && $_FILES['file']['size'] > grav_limit) {
|
||||||
$this->admin->json_response = ['status' => 'error', 'message' => 'Exceeded Grav filesize limit.'];
|
$this->admin->json_response = ['status' => 'error', 'message' => $this->admin->translate('PLUGIN_ADMIN.EXCEEDED_GRAV_FILESIZE_LIMIT')];
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -486,18 +486,18 @@ class AdminController
|
|||||||
|
|
||||||
// If not a supported type, return
|
// If not a supported type, return
|
||||||
if (!$config->get("media.{$fileExt}")) {
|
if (!$config->get("media.{$fileExt}")) {
|
||||||
$this->admin->json_response = ['status' => 'error', 'message' => 'Unsupported file type: '.$fileExt];
|
$this->admin->json_response = ['status' => 'error', 'message' => $this->admin->translate('PLUGIN_ADMIN.UNSUPPORTED_FILE_TYPE') . ': '.$fileExt];
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Upload it
|
// Upload it
|
||||||
if (!move_uploaded_file($_FILES['file']['tmp_name'], sprintf('%s/%s', $page->path(), $_FILES['file']['name']))) {
|
if (!move_uploaded_file($_FILES['file']['tmp_name'], sprintf('%s/%s', $page->path(), $_FILES['file']['name']))) {
|
||||||
$this->admin->json_response = ['status' => 'error', 'message' => 'Failed to move uploaded file.'];
|
$this->admin->json_response = ['status' => 'error', 'message' => $this->admin->translate('PLUGIN_ADMIN.FAILED_TO_MOVE_UPLOADED_FILE')];
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->admin->json_response = ['status' => 'success', 'message' => 'File uploaded successfully'];
|
$this->admin->json_response = ['status' => 'success', 'message' => $this->admin->translate('PLUGIN_ADMIN.FILE_UPLOADED_SUCCESSFULLY')];
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -516,7 +516,7 @@ class AdminController
|
|||||||
$page = $this->admin->page(true);
|
$page = $this->admin->page(true);
|
||||||
|
|
||||||
if (!$page) {
|
if (!$page) {
|
||||||
$this->admin->json_response = ['status' => 'error', 'message' => 'No Page found'];
|
$this->admin->json_response = ['status' => 'error', 'message' => $this->admin->translate('PLUGIN_ADMIN.NO_PAGE_FOUND')];
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -526,15 +526,15 @@ class AdminController
|
|||||||
|
|
||||||
if (file_exists($targetPath)) {
|
if (file_exists($targetPath)) {
|
||||||
if (unlink($targetPath)) {
|
if (unlink($targetPath)) {
|
||||||
$this->admin->json_response = ['status' => 'success', 'message' => 'File deleted: '.$filename];
|
$this->admin->json_response = ['status' => 'success', 'message' => $this->admin->translate('PLUGIN_ADMIN.FILE_DELETED') . ': '.$filename];
|
||||||
} else {
|
} else {
|
||||||
$this->admin->json_response = ['status' => 'error', 'message' => 'File could not be deleted: '.$filename];
|
$this->admin->json_response = ['status' => 'error', 'message' => $this->admin->translate('PLUGIN_ADMIN.FILE_COULD_NOT_BE_DELETED') . ': '.$filename];
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$this->admin->json_response = ['status' => 'error', 'message' => 'File not found: '.$filename];
|
$this->admin->json_response = ['status' => 'error', 'message' => $this->admin->translate('PLUGIN_ADMIN.FILE_NOT_FOUND') . ': '.$filename];
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$this->admin->json_response = ['status' => 'error', 'message' => 'No file found'];
|
$this->admin->json_response = ['status' => 'error', 'message' => $this->admin->translate('PLUGIN_ADMIN.NO_FILE_FOUND')];
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@@ -553,7 +553,7 @@ class AdminController
|
|||||||
$page = $this->admin->page(true);
|
$page = $this->admin->page(true);
|
||||||
|
|
||||||
if (!$page) {
|
if (!$page) {
|
||||||
$this->admin->json_response = ['status' => 'error', 'message' => 'No Page found'];
|
$this->admin->json_response = ['status' => 'error', 'message' => $this->admin->translate('PLUGIN_ADMIN.NO_PAGE_FOUND')];
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -701,9 +701,9 @@ class AdminController
|
|||||||
$result = \Grav\Plugin\Admin\Gpm::selfupgrade();
|
$result = \Grav\Plugin\Admin\Gpm::selfupgrade();
|
||||||
|
|
||||||
if ($result) {
|
if ($result) {
|
||||||
$this->admin->json_response = ['status' => 'success', 'message' => 'Grav was successfully updated to '];
|
$this->admin->json_response = ['status' => 'success', 'message' => $this->admin->translate('PLUGIN_ADMIN.GRAV_WAS_SUCCESSFULLY_UPDATED_TO') . ' '];
|
||||||
} else {
|
} else {
|
||||||
$this->admin->json_response = ['status' => 'error', 'message' => 'Grav update failed <br>' . Installer::lastErrorMsg()];
|
$this->admin->json_response = ['status' => 'error', 'message' => $this->admin->translate('PLUGIN_ADMIN.GRAV_UPDATE_FAILED') . ' <br>' . Installer::lastErrorMsg()];
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@@ -747,9 +747,9 @@ class AdminController
|
|||||||
if ($this->view === 'update') {
|
if ($this->view === 'update') {
|
||||||
|
|
||||||
if ($result) {
|
if ($result) {
|
||||||
$this->admin->json_response = ['status' => 'success', 'message' => 'Everything updated'];
|
$this->admin->json_response = ['status' => 'success', 'message' => $this->admin->translate('PLUGIN_ADMIN.EVERYTHING_UPDATED')];
|
||||||
} else {
|
} else {
|
||||||
$this->admin->json_response = ['status' => 'error', 'message' => 'Updates failed'];
|
$this->admin->json_response = ['status' => 'error', 'message' => $this->admin->translate('PLUGIN_ADMIN.UPDATES_FAILED')];
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -142,6 +142,31 @@ en:
|
|||||||
SUCCESSFULLY_DELETED: Successfully deleted
|
SUCCESSFULLY_DELETED: Successfully deleted
|
||||||
SUCCESSFULLY_SWITCHED_LANGUAGE: Successfully switched language
|
SUCCESSFULLY_SWITCHED_LANGUAGE: Successfully switched language
|
||||||
INSUFFICIENT_PERMISSIONS_FOR_TASK: You have insufficient permissions for task
|
INSUFFICIENT_PERMISSIONS_FOR_TASK: You have insufficient permissions for task
|
||||||
|
CACHE_CLEARED: Cache cleared
|
||||||
|
METHOD: Method
|
||||||
|
ERROR_CLEARING_CACHE: Error clearing cache
|
||||||
|
AN_ERROR_OCCURRED: An error occurred
|
||||||
|
YOUR_BACKUP_IS_READY_FOR_DOWNLOAD: Your backup is ready for download
|
||||||
|
DOWNLOAD_BACKUP: Download backup
|
||||||
|
PAGES_FILTERED: Pages filtered
|
||||||
|
NO_PAGE_FOUND: No Page found
|
||||||
|
INVALID_PARAMETERS: Invalid Parameters
|
||||||
|
NO_FILES_SENT: No files sent
|
||||||
|
EXCEEDED_FILESIZE_LIMIT: Exceeded filesize limit
|
||||||
|
UNKNOWN_ERRORS: Unkown errors
|
||||||
|
EXCEEDED_GRAV_FILESIZSE_LIMIT: Exceeded Grav filesize limit.
|
||||||
|
UNSUPPORTED_FILE_TYPE: Unsupported file type
|
||||||
|
FAILED_TO_MOVE_UPLOADED_FILE: Failed to move uploaded file.
|
||||||
|
FILE_UPLOADED_SUCCESSFULLY: File uploaded successfully
|
||||||
|
FILE_DELETED: File deleted
|
||||||
|
FILE_COULD_NOT_BE_DELETED: File could not be deleted
|
||||||
|
FILE_NOT_FOUND: File not found
|
||||||
|
NO_FILE_FOUND: No file found
|
||||||
|
GRAV_WAS_SUCCESSFULLY_UPDATED_TO: Grav was successfully updated to
|
||||||
|
GRAV_UPDATE_FAILED: Grav update failed
|
||||||
|
EVERYTHING_UPDATED: Everything updated
|
||||||
|
UPDATES_FAILED: Updates failed
|
||||||
|
|
||||||
es:
|
es:
|
||||||
ADMIN_BETA_MSG: ¡Está es una versión Beta! Utilízala bajo tu propio riesgo...
|
ADMIN_BETA_MSG: ¡Está es una versión Beta! Utilízala bajo tu propio riesgo...
|
||||||
ADMIN_REPORT_ISSUE: ¿Encontraste algún problema de funcionamiento? Por favor, repórtalo en GitHub.
|
ADMIN_REPORT_ISSUE: ¿Encontraste algún problema de funcionamiento? Por favor, repórtalo en GitHub.
|
||||||
@@ -306,3 +331,27 @@ it:
|
|||||||
SUCCESSFULLY_DELETED: Eliminato con successo
|
SUCCESSFULLY_DELETED: Eliminato con successo
|
||||||
SUCCESSFULLY_SWITCHED_LANGUAGE: Lingua cambiata con successo
|
SUCCESSFULLY_SWITCHED_LANGUAGE: Lingua cambiata con successo
|
||||||
INSUFFICIENT_PERMISSIONS_FOR_TASK: Permissi insufficenti per l'operazione
|
INSUFFICIENT_PERMISSIONS_FOR_TASK: Permissi insufficenti per l'operazione
|
||||||
|
CACHE_CLEARED: Cache pulita
|
||||||
|
METHOD: Metodo
|
||||||
|
ERROR_CLEARING_CACHE: Errore nella pulizia della cache
|
||||||
|
AN_ERROR_OCCURRED: Errore rilevato
|
||||||
|
YOUR_BACKUP_IS_READY_FOR_DOWNLOAD: Il tuo backup è pronto per il download
|
||||||
|
DOWNLOAD_BACKUP: Scarica backup
|
||||||
|
PAGES_FILTERED: Pagine filtrate
|
||||||
|
NO_PAGE_FOUND: Nessuna pagina trovata
|
||||||
|
INVALID_PARAMETERS: Parametri invalidi
|
||||||
|
NO_FILES_SENT: Nessun file inviato
|
||||||
|
EXCEEDED_FILESIZE_LIMIT: Superati i limiti di dimensione file
|
||||||
|
UNKNOWN_ERRORS: Errore sconosciuto
|
||||||
|
EXCEEDED_GRAV_FILESIZE_LIMIT: Superato il limite di upload file
|
||||||
|
UNSUPPORTED_FILE_TYPE: Tipo di file non supportato
|
||||||
|
FAILED_TO_MOVE_UPLOADED_FILE: Fallito lo spostamento del file caricato
|
||||||
|
FILE_UPLOADED_SUCCESSFULLY: File caricato con successo
|
||||||
|
FILE_DELETED: File eliminato
|
||||||
|
FILE_COULD_NOT_BE_DELETED: Il file non può essere eliminato
|
||||||
|
FILE_NOT_FOUND: File non trovato
|
||||||
|
NO_FILE_FOUND: Nessun file trovato
|
||||||
|
GRAV_WAS_SUCCESSFULLY_UPDATED_TO: Grav è stato correttamente aggiornato a
|
||||||
|
GRAV_UPDATE_FAILED: Aggiornamento di Grav fallito
|
||||||
|
EVERYTHING_UPDATED: Tutto aggiornato
|
||||||
|
UPDATES_FAILED: Aggiornamento fallito
|
||||||
|
|||||||
Reference in New Issue
Block a user