Skip to content

Commit

Permalink
support multilingual sites
Browse files Browse the repository at this point in the history
  • Loading branch information
ashwinimone committed Jan 20, 2020
1 parent e453ceb commit 9451017
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/PathBreadcrumbBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,13 @@ public function build(RouteMatchInterface $route_match) {
// @todo Find a better way to deal with /user.
$exclude['/user'] = TRUE;

if (\Drupal::languageManager() && \Drupal::languageManager()->isMultilingual() && $languages = \Drupal::languageManager()->getLanguages()) {
$language_slugs = array_keys($languages);
foreach ($language_slugs as $lang) {
$exclude["/{$lang}"] = TRUE;
}
}

$prefix = array_slice($path_elements, 0, -1);
if (!empty($prefix)) {
$prefix_path = '/' . implode('/', $prefix);
Expand Down

0 comments on commit 9451017

Please sign in to comment.