diff --git a/classes/controller.php b/classes/controller.php index 293b660e..de75acdc 100644 --- a/classes/controller.php +++ b/classes/controller.php @@ -588,7 +588,7 @@ class AdminController $this->post = array('enabled' => 1, '_redirect' => 'plugins'); $obj = $this->prepareData(); $obj->save(); - $this->admin->setMessage('Successfully enabled plugin', 'info'); + $this->admin->setMessage($this->admin->translate('PLUGIN_ADMIN.SUCCESSFULLY_ENABLED_PLUGIN'), 'info'); return true; } @@ -612,7 +612,7 @@ class AdminController $this->post = array('enabled' => 0, '_redirect' => 'plugins'); $obj = $this->prepareData(); $obj->save(); - $this->admin->setMessage('Successfully disabled plugin', 'info'); + $this->admin->setMessage($this->admin->translate('PLUGIN_ADMIN.SUCCESSFULLY_DISABLED_PLUGIN'), 'info'); return true; } @@ -651,7 +651,7 @@ class AdminController // TODO: find out why reload and save doesn't always update the object itself (and remove this workaround). $config->set('system.pages.theme', $name); - $this->admin->setMessage('Successfully changed default theme.', 'info'); + $this->admin->setMessage($this->admin->translate('PLUGIN_ADMIN.SUCCESSFULLY_CHANGED_THEME'), 'info'); return true; } @@ -675,9 +675,9 @@ class AdminController $result = \Grav\Plugin\Admin\Gpm::install($package, []); if ($result) { - $this->admin->setMessage("Installation successful.", 'info'); + $this->admin->setMessage($this->admin->translate('PLUGIN_ADMIN.INSTALLATION_SUCCESSFUL'), 'info'); } else { - $this->admin->setMessage("Installation failed.", 'error'); + $this->admin->setMessage($this->admin->translate('PLUGIN_ADMIN.INSTALLATION_FAILED'), 'error'); } $this->post = array('_redirect' => $this->view . '/' . $this->route); @@ -754,9 +754,9 @@ class AdminController } else { if ($result) { - $this->admin->setMessage("Installation successful.", 'info'); + $this->admin->setMessage($this->admin->translate('PLUGIN_ADMIN.INSTALLATION_SUCCESSFUL'), 'info'); } else { - $this->admin->setMessage("Installation failed.", 'error'); + $this->admin->setMessage($this->admin->translate('PLUGIN_ADMIN.INSTALLATION_FAILED'), 'error'); } $this->post = array('_redirect' => $this->view . '/' . $this->route); @@ -784,9 +784,9 @@ class AdminController $result = \Grav\Plugin\Admin\Gpm::uninstall($package, []); if ($result) { - $this->admin->setMessage("Uninstall successful.", 'info'); + $this->admin->setMessage($this->admin->translate('PLUGIN_ADMIN.INSTALLATION_SUCCESSFUL'), 'info'); } else { - $this->admin->setMessage("Uninstall failed.", 'error'); + $this->admin->setMessage($this->admin->translate('PLUGIN_ADMIN.INSTALLATION_FAILED'), 'error'); } $this->post = array('_redirect' => $this->view); @@ -852,7 +852,7 @@ class AdminController if ($obj) { $obj->save($reorder); - $this->admin->setMessage('Successfully saved', 'info'); + $this->admin->setMessage($this->admin->translate('PLUGIN_ADMIN.SUCCESSFULLY_SAVED'), 'info'); } if ($this->view != 'pages') { @@ -956,7 +956,7 @@ class AdminController $page->save(); // Enqueue message and redirect to new location. - $this->admin->setMessage('Successfully copied', 'info'); + $this->admin->setMessage($this->admin->translate('PLUGIN_ADMIN.SUCCESSFULLY_COPIED'), 'info'); $this->setRedirect($this->view . '/' . $parent->route() . '/'. $page->slug()); } catch (\Exception $e) { @@ -982,7 +982,7 @@ class AdminController return false; } - $this->admin->setMessage('Reordering was successful', 'info'); + $this->admin->setMessage($this->admin->translate('PLUGIN_ADMIN.REORDERING_WAS_SUCCESSFUL'), 'info'); return true; } @@ -1018,7 +1018,7 @@ class AdminController $redirect = 'pages'; } - $this->admin->setMessage('Successfully deleted', 'info'); + $this->admin->setMessage($this->admin->translate('PLUGIN_ADMIN.SUCCESSFULLY_DELETED'), 'info'); $this->setRedirect($redirect); } catch (\Exception $e) { @@ -1037,7 +1037,7 @@ class AdminController $redirect = 'pages'; - $this->admin->setMessage('Successfully switched language', 'info'); + $this->admin->setMessage($this->admin->translate('PLUGIN_ADMIN.SUCCESSFULLY_SWITCHED_LANGUAGE'), 'info'); $this->setRedirect($redirect); return true; @@ -1212,9 +1212,9 @@ class AdminController { if (!$this->admin->authorise($permissions)) { if ($this->grav['uri']->extension() === 'json') - $this->admin->json_response = ['status' => 'unauthorized', 'message' => 'You have insufficient permissions for task ' . $task . '.']; + $this->admin->json_response = ['status' => 'unauthorized', 'message' => $this->admin->translate('PLUGIN_ADMIN.INSUFFICIENT_PERMISSIONS_FOR_TASK') . ' ' . $task . '.']; else - $this->admin->setMessage('You have insufficient permissions for task ' . $task . '.', 'error'); + $this->admin->setMessage($this->admin->translate('PLUGIN_ADMIN.INSUFFICIENT_PERMISSIONS_FOR_TASK') . ' ' . $task . '.', 'error'); return false; } diff --git a/languages.yaml b/languages.yaml index 1e0e1c57..e98d2671 100644 --- a/languages.yaml +++ b/languages.yaml @@ -131,7 +131,17 @@ en: USER: User ADD_ACCOUNT: Add Account SWITCH_LANGUAGE: Switch Language - + SUCCESSFULLY_ENABLED_PLUGIN: Successfully enabled plugin + SUCCESSFULLY_DISABLED_PLUGIN: Successfully disabled plugin + SUCCESSFULLY_CHANGED_THEME: Successfully changed default theme + INSTALLATION_FAILED: Installation failed + INSTALLATION_SUCCESSFUL: Installation successful + SUCCESSFULLY_SAVED: Successfully saved + SUCCESSFULLY_COPIED: Successfully copied + REORDERING_WAS_SUCCESSFUL: Reordering was successful + SUCCESSFULLY_DELETED: Successfully deleted + SUCCESSFULLY_SWITCHED_LANGUAGE: Successfully switched language + INSUFFICIENT_PERMISSIONS_FOR_TASK: You have insufficient permissions for task es: 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. @@ -284,4 +294,15 @@ it: SYSTEM: Sistema USER: Utente ADD_ACCOUNT: Aggiungi utente - SWITCH_LANGUAGE: Cambia lingua \ No newline at end of file + SWITCH_LANGUAGE: Cambia lingua + SUCCESSFULLY_ENABLED_PLUGIN: Plugin abilitato con successo + SUCCESSFULLY_DISABLED_PLUGIN: Plugin disabilitato con successo + SUCCESSFULLY_CHANGED_THEME: Tema cambiato con successo + INSTALLATION_FAILED: Intallazione fallita + INSTALLATION_SUCCESSFUL: Installazione avvenuta con successo + SUCCESSFULLY_SAVED: Salvato con successo + SUCCESSFULLY_COPIED: Copiato con successo + REORDERING_WAS_SUCCESSFUL: Riordinato con successo + SUCCESSFULLY_DELETED: Eliminato con successo + SUCCESSFULLY_SWITCHED_LANGUAGE: Lingua cambiata con successo + INSUFFICIENT_PERMISSIONS_FOR_TASK: Permissi insufficenti per l'operazione