From ebdfa5f2ecf6a6f7a232dafd942686808ab2e7e7 Mon Sep 17 00:00:00 2001 From: Chris Myers Date: Thu, 19 Oct 2017 21:16:43 +0100 Subject: [PATCH] Fix #3626 further refactor --- src/lib/locale/locales.js | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/lib/locale/locales.js b/src/lib/locale/locales.js index d3c565e79..e45415fca 100644 --- a/src/lib/locale/locales.js +++ b/src/lib/locale/locales.js @@ -131,16 +131,11 @@ export function defineLocale (name, config) { export function updateLocale(name, config) { if (config != null) { - var locale, parentConfig = baseConfig; + var locale, tmpLocale, parentConfig = baseConfig; // MERGE - if (locales[name] != null) { - parentConfig = locales[name]._config; - } - else { - locale = loadLocale(name); - if (locale != null) { - parentConfig = locale._config; - } + tmpLocale = locales[name] || loadLocale(name); + if (tmpLocale != null) { + parentConfig = tmpLocale._config; } config = mergeConfigs(parentConfig, config); locale = new Locale(config); -- 2.47.2