Add current language prefix

Created on 27 June 2020, about 4 years ago
Updated 6 September 2023, 10 months ago
$lang = \Drupal::languageManager()->getCurrentLanguage()->getId();
$languages_prefixes_arr = \Drupal::config('language.negotiation')->get('url.prefixes');
$language_prefix = ($languages_prefixes_arr[$lang]) ? '/' . $languages_prefixes_arr[$lang] : FALSE;
✨ Feature request
Status

Closed: won't fix

Version

1.0

Component

Code

Created by

🇮🇱Israel Promo-IL

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇧🇪Belgium zero2one

    Module no longer supported

    Replace the tokens from this module by the tokens from the Token module & uninstall this module.

    The current language prefix is available in the Token module: [language:prefix]

Production build 0.69.0 2024