There's more...

Many browsers have differences in the way they return browser language configurations. For example, Safari returns the browser language locale as en-us instead of en-US like other browsers. Browsers such as IE 9 and 10 don't even provide navigation.language and instead rely on their own navigation.browserLanguage property. An easy fix to this problem is to normalize both options into your document.locale value in lowercase format, as follows:

document.locale = (navigator.language || navigator.browserLanguage).toLowerCase();

Angular will still recognize these as valid locale properties for our date localization.

You can learn more about how these language configurations are provided in the browser and their various compatibility quirks in the following Mozilla's official JavaScript documentation:
https://developer.mozilla.org/en-US/docs/Web/API/NavigatorLanguage/language

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
13.58.25.75