Fixes: U4-6998 User language drop down is incorrect when default language is used
This commit is contained in:
@@ -191,6 +191,23 @@ namespace Umbraco.Core.Services
|
||||
return attempt ? attempt.Result : currentCulture;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// HAAAAAAAAAAACK! Used for backwards compat to convert a user's real culture code to a region code - normally this would be two letters
|
||||
/// </summary>
|
||||
/// <param name="currentCulture"></param>
|
||||
/// <returns></returns>
|
||||
public string ConvertToRegionCodeFromSupportedCulture(CultureInfo currentCulture)
|
||||
{
|
||||
if (currentCulture == null) throw new ArgumentNullException("currentCulture");
|
||||
|
||||
if (_fileSources == null) return currentCulture.Name;
|
||||
|
||||
var attempt = _fileSources.Value.TryConvert4LetterCultureTo2Letter(currentCulture);
|
||||
return attempt
|
||||
? attempt.Result
|
||||
: currentCulture.Name;
|
||||
}
|
||||
|
||||
private string GetFromDictionarySource(CultureInfo culture, string area, string key, IDictionary<string, string> tokens)
|
||||
{
|
||||
if (_dictionarySource.ContainsKey(culture) == false)
|
||||
|
||||
Reference in New Issue
Block a user