You are here

function MenuLeaf::getLanguagePrefix in Taxonomy Facets 8

1 call to MenuLeaf::getLanguagePrefix()
MenuLeaf::buildLinkUrl in src/MenuLeaf.php

File

src/MenuLeaf.php, line 116

Class

MenuLeaf

Namespace

Drupal\taxonomy_facets

Code

function getLanguagePrefix() {
  if ($prefixes = \Drupal::config('language.negotiation')
    ->get('url.prefixes')) {
    $language = \Drupal::languageManager()
      ->getCurrentLanguage()
      ->getId();
    if ($prefixes[$language]) {
      return "/" . $prefixes[$language];
    }
  }

  // @TODO add case when using different domains for language negotiation.
  // kint($config->get('url.domains'));
  return null;
}