Skip to content

Commit

Permalink
chore(bundle): updated bundle
Browse files Browse the repository at this point in the history
  • Loading branch information
ocombe committed Aug 13, 2016
1 parent 8f9763b commit d76f035
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions bundles/ng2-translate.js
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,18 @@ System.registerDynamic("src/translate.service", ["@angular/core", "rxjs/Observab
TranslateService.prototype.resetLang = function(lang) {
this.translations[lang] = undefined;
};
TranslateService.prototype.getBrowserLang = function() {
if (typeof window === 'undefined' || typeof window.navigator === 'undefined') {
return undefined;
}
var browserLang;
if (typeof window.navigator['languages'] !== 'undefined' && window.navigator['languages'].length > 0) {
browserLang = window.navigator['languages'][0].indexOf('-') !== -1 || window.navigator['languages'].length < 2 ? window.navigator['languages'][0] : window.navigator['languages'][1];
} else {
browserLang = window.navigator['language'] || window.navigator['browserLanguage'];
}
return browserLang && browserLang.length ? browserLang.split('-')[0] : undefined;
};
TranslateService = __decorate([core_1.Injectable(), __param(1, core_1.Optional()), __metadata('design:paramtypes', [TranslateLoader, MissingTranslationHandler])], TranslateService);
return TranslateService;
}());
Expand Down

0 comments on commit d76f035

Please sign in to comment.