Skip to content

Commit

Permalink
Fixes pencilblue#1142 - corrects bug where supported locales were not…
Browse files Browse the repository at this point in the history
… updated.
  • Loading branch information
brianhyder committed Sep 22, 2016
1 parent 8538d82 commit 37f1605
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions include/localization.js
Original file line number Diff line number Diff line change
Expand Up @@ -787,6 +787,7 @@ module.exports = function LocalizationModule(pb) {

//remove from quick lookup
delete Localization.supportedLookup[Localization.formatLocale(locale.language, locale.countryCode)];
Localization.supported = new Locale.Locales(Object.keys(Localization.supportedLookup));
return keysRemoved > 0;
};

Expand Down
3 changes: 3 additions & 0 deletions test/include/localization_tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,9 @@ describe('Localization', function() {
var locale = 'nl-BE';
Localization.unregisterLocale(locale).should.eql(true);
Localization.isSupported(locale).should.eql(false);
Localization.getSupported().filter(function(localeObj) {
return localeObj.toString() === locale;
}).length.should.eql(0);
});

it('should return false when an unregistered locale is passed', function() {
Expand Down

0 comments on commit 37f1605

Please sign in to comment.