How to get correct language code during installation? I am programmatically creating some content during installation of my profile and I need to set the language for this content, otherwise it will be in English(which my site is not) and there will be issues with visibility of fields.

What is the proper way to get the language code in which the site is being installed? The language manager service is returning English, which is incorrect.
Looks like getting it directly from config is working just fine:

\Drupal::config('system.site')-&gt;get('langcode')