While everything functions correctly in Chrome, there seems to be an issue with changing the language in Safari and Firefox.
angular.module('angularApp')
.config(['$translateProvider', function ($translateProvider) {
$translateProvider.usePostCompiling(true)
.useStaticFilesLoader({
prefix: 'i18n/locale-',
suffix: '.json'
})
.registerAvailableLanguageKeys(['de','en'],{
'de_DE': 'de',
'en-*': 'en'
})
.preferredLanguage('de')
.determinePreferredLanguage()
.fallbackLanguage('de');
}]);
In my Controller, I have implemented code to change the language. This works smoothly in Chrome, but encounters issues in Safari and Firefox without any error messages or console output...
.controller('NavbarCtrl', function ($scope, $translate) {
$scope.changeLanguage = function (langKey) {
$translate.use(langKey).catch(function (err) {
$translate.use($translate.fallbackLanguage());
});
};
});
///// UPDATE Interestingly, I encounter a similar problem in Chrome when switching the language to English. It appears that the request to load locale-de.json is being cancelled for some reason. https://i.stack.imgur.com/PYcCv.png