Skip culture check when unnecessary
This commit is contained in:
parent
fde783911b
commit
a7bf77b877
|
|
@ -1,4 +1,4 @@
|
||||||
// Copyright (c) .NET Foundation. All rights reserved.
|
// Copyright (c) .NET Foundation. All rights reserved.
|
||||||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
|
@ -59,8 +59,7 @@ namespace Microsoft.AspNetCore.Localization.Routing
|
||||||
// Value for culture but not for UI culture so default to culture value for both
|
// Value for culture but not for UI culture so default to culture value for both
|
||||||
uiCulture = culture;
|
uiCulture = culture;
|
||||||
}
|
}
|
||||||
|
else if (culture == null && uiCulture != null)
|
||||||
if (culture == null && uiCulture != null)
|
|
||||||
{
|
{
|
||||||
// Value for UI culture but not for culture so default to UI culture value for both
|
// Value for UI culture but not for culture so default to UI culture value for both
|
||||||
culture = uiCulture;
|
culture = uiCulture;
|
||||||
|
|
@ -71,4 +70,4 @@ namespace Microsoft.AspNetCore.Localization.Routing
|
||||||
return Task.FromResult(providerResultCulture);
|
return Task.FromResult(providerResultCulture);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -109,8 +109,7 @@ namespace Microsoft.AspNetCore.Localization
|
||||||
// Value for culture but not for UI culture so default to culture value for both
|
// Value for culture but not for UI culture so default to culture value for both
|
||||||
uiCultureName = cultureName;
|
uiCultureName = cultureName;
|
||||||
}
|
}
|
||||||
|
else if (cultureName == null && uiCultureName != null)
|
||||||
if (cultureName == null && uiCultureName != null)
|
|
||||||
{
|
{
|
||||||
// Value for UI culture but not for culture so default to UI culture value for both
|
// Value for UI culture but not for culture so default to UI culture value for both
|
||||||
cultureName = uiCultureName;
|
cultureName = uiCultureName;
|
||||||
|
|
|
||||||
|
|
@ -64,8 +64,7 @@ namespace Microsoft.AspNetCore.Localization
|
||||||
// Value for culture but not for UI culture so default to culture value for both
|
// Value for culture but not for UI culture so default to culture value for both
|
||||||
queryUICulture = queryCulture;
|
queryUICulture = queryCulture;
|
||||||
}
|
}
|
||||||
|
else if (queryCulture == null && queryUICulture != null)
|
||||||
if (queryCulture == null && queryUICulture != null)
|
|
||||||
{
|
{
|
||||||
// Value for UI culture but not for culture so default to UI culture value for both
|
// Value for UI culture but not for culture so default to UI culture value for both
|
||||||
queryCulture = queryUICulture;
|
queryCulture = queryUICulture;
|
||||||
|
|
|
||||||
|
|
@ -126,8 +126,7 @@ namespace Microsoft.AspNetCore.Localization
|
||||||
{
|
{
|
||||||
cultureInfo = _options.DefaultRequestCulture.Culture;
|
cultureInfo = _options.DefaultRequestCulture.Culture;
|
||||||
}
|
}
|
||||||
|
else if (cultureInfo != null && uiCultureInfo == null)
|
||||||
if (cultureInfo != null && uiCultureInfo == null)
|
|
||||||
{
|
{
|
||||||
uiCultureInfo = _options.DefaultRequestCulture.UICulture;
|
uiCultureInfo = _options.DefaultRequestCulture.UICulture;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue