Is there a way in the drupal 8 api to figure out if a language prefix is present in the url or not? Cause I need this information in order to display a custom language switcher if no prefix exists in the url. So for language detection I only have the prefix enabled.
Unfortunately this code is not working for me:
$languagecode = \Drupal::languageManager()->getCurrentLanguage()->getId();
Cause it always returns me a language. When no prefix is present in the url it returns me (as excepted) the fallback language.
Has someone a similar situation or can help me here?