Get current country pathPrefix How can I get current country pathPrefix in D8 ?

I know drupalSettings.path.pathPrefix gives that in JS, but how can I get it in preprocess hook ?

Following gives only the path alias, but without pathPrefix.

\Drupal::service('path.alias_manager')-&gt;getAliasByPath('/node/'.$nid[0]);
You can call PathProcessorManager::processOutbound() for the internal path and you get the path alias and the prefix at the same time:

$options = ['prefix' =&gt; ''];
$path = \Drupal::service('path_processor_manager')-&gt;processOutbound('/node/1', $options);
$prefix = $options['prefix'];