How can I get current localization id number the game is using?

Hello, I’m using Unity Localization Package (version 1.4.3). And I want to get an ID number of localization, which my game is using by the moment.

I’ve seen this solution on unity forum:
https://forum.unity.com/threads/how-to-get-the-current-locale-the-game-is-using.1276523/

But there The Questioner gets string Locale Identifier, but not a number, that I need.
I know, that I can set a locale by this code:

LocalizationSettings.SelectedLocale = LocalizationSettings.AvailableLocales.Locales[localeID];

But I do not know how to get that value or maybe I can’t get that value at all.

So, I will be very greateful if someone answer my question.

SortOrder is used to control the order of the Locales but its not the index. What you need is the index of where the Locale is in the list.

var myLocale = LocalizationSettings.AvailableLocales.GetLocale("en");
var localeID - LocalizationSettings.AvailableLocales.Locales.IndexOf(myLocale);
LocalizationSettings.SelectedLocale = LocalizationSettings.AvailableLocales.Locales[localeID];
LocalizationSettings.SelectedLocale.SortOrder;

Seems to do that. Hope it will help someone. You should also probably make sure you do that after your localization fully loaded.