You are here

GoToDefaultLanguage.php in String Overrides 8

File

src/Controllers/GoToDefaultLanguage.php
View source
<?php

namespace Drupal\stringoverrides\Controllers;

use Drupal\Core\Controller\ControllerBase;

/**
 * Class GoToDefaultLanguage.
 *
 * @package Drupal\stringoverrides\Controllers
 */
class GoToDefaultLanguage extends ControllerBase {

  /**
   * Redirect user to admin form for default language.
   *
   * @return \Symfony\Component\HttpFoundation\RedirectResponse
   *   Symfony redirect.
   */
  public function go() {
    $language = \Drupal::languageManager()
      ->getDefaultLanguage();
    return $this
      ->redirect('stringoverrides.translations_form', [
      'language' => $language
        ->getId(),
    ]);
  }

}

Classes

Namesort descending Description
GoToDefaultLanguage Class GoToDefaultLanguage.