Skip to content

Commit

Permalink
Merge pull request #2779 from vanilla/hotfix/locale-structure-canonic…
Browse files Browse the repository at this point in the history
…alize

Make sure the config locale is canonicalized
  • Loading branch information
initvector committed May 26, 2015
2 parents 773e31f + 41f3670 commit 47e3d70
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions applications/dashboard/settings/structure.php
Expand Up @@ -794,6 +794,13 @@
// This will allow us to change the default later and grandfather existing forums in.
SaveToConfig('Garden.InputFormatter', C('Garden.InputFormatter'));

// Make sure the default locale is in its canonical form.
$currentLocale = C('Garden.Locale');
$canonicalLocale = Gdn_Locale::Canonicalize($currentLocale);
if ($currentLocale !== $canonicalLocale) {
SaveToConfig('Garden.Locale', $canonicalLocale);
}

// We need to undo cleditor's bad behavior for our reformed users.
// If you still need to manipulate this, do it in memory instead (SAVE = false).
if (!C('Garden.Html.SafeStyles')) {
Expand Down
2 changes: 1 addition & 1 deletion library/core/class.locale.php
Expand Up @@ -106,7 +106,7 @@ public static function Canonicalize($locale) {
// This is a bit of a kludge, but we are deprecating en_CA in favour of just en.
if ($result === 'en_CA') {
$result = 'en';
}
}

return $result;
}
Expand Down

0 comments on commit 47e3d70

Please sign in to comment.