diff --git a/CHANGES.rst b/CHANGES.rst index 83097a4f1..f8d6fcfce 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -39,6 +39,10 @@ Bug fixes: - Tinymce: Fix issue where Webpack less-loader was unable to load TinyMCE bundle styles [datakurre] +- Fix for loading country specific language codes + [lyralemos] + + 2.7.2 (2018-04-08) ------------------ diff --git a/mockup/js/i18n.js b/mockup/js/i18n.js index 0f60d351c..bb2d338fc 100644 --- a/mockup/js/i18n.js +++ b/mockup/js/i18n.js @@ -19,6 +19,12 @@ define([ self.baseUrl = '/plonejsi18n'; } self.currentLanguage = $('html').attr('lang') || 'en-us'; + + // Fix for country specific languages + if (self.currentLanguage.split('-').length > 1) { + self.currentLanguage = self.currentLanguage.split('-')[0] + '_' + self.currentLanguage.split('-')[1].toUpperCase(); + } + self.storage = null; self.catalogs = {}; self.ttl = 24 * 3600 * 1000;