11921: Update CultureName after language change
This commit is contained in:
committed by
Michael Latouche
parent
69132faffa
commit
9121879e1a
@@ -174,6 +174,19 @@ namespace Umbraco.Cms.Web.BackOffice.Controllers
|
||||
return ValidationProblem(ModelState);
|
||||
}
|
||||
|
||||
// Update language
|
||||
CultureInfo cultureAfterChange;
|
||||
try
|
||||
{
|
||||
// language has the CultureName of the previous lang so we get information about new culture.
|
||||
cultureAfterChange = CultureInfo.GetCultureInfo(language.IsoCode);
|
||||
}
|
||||
catch (CultureNotFoundException)
|
||||
{
|
||||
ModelState.AddModelError("IsoCode", "No Culture found with name " + language.IsoCode);
|
||||
return ValidationProblem(ModelState);
|
||||
}
|
||||
existingById.CultureName = cultureAfterChange.DisplayName;
|
||||
existingById.IsDefault = language.IsDefault;
|
||||
existingById.FallbackLanguageId = language.FallbackLanguageId;
|
||||
existingById.IsoCode = language.IsoCode;
|
||||
|
||||
Reference in New Issue
Block a user