You are here

public function WebformTranslationManager::isAdminRoute in Webform 6.x

Same name and namespace in other branches
  1. 8.5 src/WebformTranslationManager.php \Drupal\webform\WebformTranslationManager::isAdminRoute()

Determine if the translated webform should be displayed.

Return value

bool TRUE if the translated webform should be displayed.

Overrides WebformTranslationManagerInterface::isAdminRoute

File

src/WebformTranslationManager.php, line 89

Class

WebformTranslationManager
Defines a class to translate webform elements.

Namespace

Drupal\webform

Code

public function isAdminRoute() {
  $route_name = $this->routeMatch
    ->getRouteName();

  // Don't initialize translation on webform CRUD routes.
  if (preg_match('/^entity\\.webform\\.(?:edit_form|duplicate_form|delete_form)$/', $route_name)) {
    return TRUE;
  }

  // Don't initialize translation on webform UI routes.
  if (strpos($route_name, 'entity.webform_ui.') === 0) {
    return TRUE;
  }
  return FALSE;
}