Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle the case where currentLanguage is null. #4823

Merged
merged 1 commit into from
Jul 26, 2020

Conversation

maliming
Copy link
Member

Default Language may not be in the language list.

private static RequestCulture DefaultGetRequestCulture(string defaultLanguage, IReadOnlyList<LanguageInfo> languages)
{
if (defaultLanguage == null)
{
var firstLanguage = languages.First();
return new RequestCulture(firstLanguage.CultureName, firstLanguage.UiCultureName);
}
var (cultureName, uiCultureName) = LocalizationSettingHelper.ParseLanguageSetting(defaultLanguage);
return new RequestCulture(cultureName, uiCultureName);
}

@maliming maliming requested a review from hikalkan July 21, 2020 13:28
@maliming maliming added this to the 3.1 milestone Jul 21, 2020
@hikalkan hikalkan merged commit 864a7e0 into dev Jul 26, 2020
@hikalkan hikalkan deleted the maliming/currentLanguage branch July 26, 2020 13:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants