Skip to content

Commit

Permalink
Merge pull request #849 from lyralemos/master
Browse files Browse the repository at this point in the history
Fix for loading country specific languages codes
  • Loading branch information
thet authored Jun 7, 2018
2 parents 2c3c68b + 5bca309 commit ff6747a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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)
------------------

Expand Down
6 changes: 6 additions & 0 deletions mockup/js/i18n.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit ff6747a

Please sign in to comment.