Skip to content

Commit

Permalink
U4-10356 Update default Config/Lang after each update
Browse files Browse the repository at this point in the history
Also makes sure UserExtensions returns the correct language
  • Loading branch information
nul800sebastiaan committed Aug 25, 2017
1 parent e71e9d7 commit 9917fb2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/Umbraco.Core/Models/UserExtensions.cs
@@ -1,5 +1,6 @@
using System;
using System.Globalization;
using Umbraco.Core.Configuration;
using Umbraco.Core.Models.Membership;
using Umbraco.Core.Services;

Expand All @@ -12,7 +13,7 @@ public static class UserExtensions
/// </summary>
/// <param name="user"></param>
/// <param name="textService"></param>
/// <returns></returns>
/// <returns></returns>
public static CultureInfo GetUserCulture(this IUser user, ILocalizedTextService textService)
{
if (user == null) throw new ArgumentNullException("user");
Expand All @@ -34,7 +35,7 @@ internal static CultureInfo GetUserCulture(string userLanguage, ILocalizedTextSe
catch (CultureNotFoundException)
{
//return the default one
return CultureInfo.GetCultureInfo("en");
return CultureInfo.GetCultureInfo(GlobalSettings.DefaultUILanguage);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/Umbraco.Web/Editors/BackOfficeController.cs
Expand Up @@ -113,7 +113,7 @@ public JsonNetResult LocalizedText(string culture = null)
? Security.IsAuthenticated()
//current culture is set at the very beginning of each request
? Thread.CurrentThread.CurrentCulture
: CultureInfo.GetCultureInfo("en")
: CultureInfo.GetCultureInfo(GlobalSettings.DefaultUILanguage)
: CultureInfo.GetCultureInfo(culture);

var textForCulture = Services.TextService.GetAllStoredValues(cultureInfo)
Expand Down

0 comments on commit 9917fb2

Please sign in to comment.