diff --git a/core/modules/language/lib/Drupal/language/Form/LanguageDeleteForm.php b/core/modules/language/lib/Drupal/language/Form/LanguageDeleteForm.php index dd7252d..e4f0eb1 100644 --- a/core/modules/language/lib/Drupal/language/Form/LanguageDeleteForm.php +++ b/core/modules/language/lib/Drupal/language/Form/LanguageDeleteForm.php @@ -8,8 +8,6 @@ namespace Drupal\language\Form; use Drupal\Core\Entity\EntityConfirmFormBase; -use Drupal\Core\Entity\EntityControllerInterface; -use Drupal\Core\Extension\ModuleHandlerInterface; use Drupal\Core\Routing\PathBasedGeneratorInterface; use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\HttpFoundation\RedirectResponse; @@ -51,7 +49,7 @@ public static function create(ContainerInterface $container) { * {@inheritdoc} */ public function getQuestion() { - return t('Are you sure you want to delete the language %language?', array('%language' => $this->entity->label())); + return $this->t('Are you sure you want to delete the language %language?', array('%language' => $this->entity->label())); } /** @@ -65,14 +63,14 @@ public function getCancelPath() { * {@inheritdoc} */ public function getDescription() { - return t('Deleting a language will remove all interface translations associated with it, and content in this language will be set to be language neutral. This action cannot be undone.'); + return $this->t('Deleting a language will remove all interface translations associated with it, and content in this language will be set to be language neutral. This action cannot be undone.'); } /** * {@inheritdoc} */ public function getConfirmText() { - return t('Delete'); + return $this->t('Delete'); } /** @@ -85,13 +83,12 @@ public function getFormID() { /** * {@inheritdoc} */ - public function buildForm(array $form, array &$form_state, Request $request = NULL) { - + public function buildForm(array $form, array &$form_state) { $langcode = $this->entity->id(); // Warn and redirect user when attempting to delete the default language. if (language_default()->id == $langcode) { - drupal_set_message(t('The default language cannot be deleted.')); + drupal_set_message($this->t('The default language cannot be deleted.')); $url = $this->urlGenerator->generateFromPath('admin/config/regional/language', array('absolute' => TRUE)); return new RedirectResponse($url); } @@ -101,7 +98,7 @@ public function buildForm(array $form, array &$form_state, Request $request = NU if (!isset($languages[$langcode])) { throw new NotFoundHttpException(); } - return parent::buildForm($form, $form_state, $request); + return parent::buildForm($form, $form_state); } /** @@ -109,12 +106,11 @@ public function buildForm(array $form, array &$form_state, Request $request = NU */ public function submit(array $form, array &$form_state) { // @todo This should be replaced with $this->entity->delete() when the - // additional logic in language_delete() is ported. + // additional logic in language_delete() is ported. $success = language_delete($this->entity->id()); if ($success) { - $options = array('%language' => $this->entity->label(), '%langcode' => $this->entity->id()); - drupal_set_message(t('The %language (%langcode) language has been removed.', $options)); + drupal_set_message($this->t('The %language (%langcode) language has been removed.', array('%language' => $this->entity->label(), '%langcode' => $this->entity->id()))); } $form_state['redirect'] = 'admin/config/regional/language'; diff --git a/core/modules/language/lib/Drupal/language/Form/NegotiationBrowserDeleteForm.php b/core/modules/language/lib/Drupal/language/Form/NegotiationBrowserDeleteForm.php index cb159e6..cb8db31 100644 --- a/core/modules/language/lib/Drupal/language/Form/NegotiationBrowserDeleteForm.php +++ b/core/modules/language/lib/Drupal/language/Form/NegotiationBrowserDeleteForm.php @@ -8,7 +8,6 @@ namespace Drupal\language\Form; use Drupal\Core\Form\ConfirmFormBase; -use Drupal\core\Language\Language; use Symfony\Component\HttpFoundation\Request; /** @@ -27,9 +26,7 @@ class NegotiationBrowserDeleteForm extends ConfirmFormBase { * {@inheritdoc} */ public function getQuestion() { - return t('Are you sure you want to delete %browser_langcode?', array( - '%browser_langcode' => $this->browserLangcode, - )); + return $this->t('Are you sure you want to delete %browser_langcode?', array('%browser_langcode' => $this->browserLangcode)); } /** @@ -49,10 +46,10 @@ public function getFormID() { /** * {@inheritdoc} */ - public function buildForm(array $form, array &$form_state, $browser_langcode = NULL, Request $request = NULL) { + public function buildForm(array $form, array &$form_state, $browser_langcode = NULL) { $this->browserLangcode = $browser_langcode; - return parent::buildForm($form, $form_state, $request); + return parent::buildForm($form, $form_state); } /** @@ -68,4 +65,5 @@ public function submitForm(array &$form, array &$form_state) { $form_state['redirect'] = 'admin/config/regional/language/detection/browser'; } + }