File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -59,10 +59,14 @@ var settings = function() {
5959
6060 this . setLanguage = function ( language ) {
6161 var languageIntlLocale ;
62- try {
63- languageIntlLocale = new Intl . Locale ( language ) . language ;
64- } catch ( e ) {
65- throw "use accepted language code provided by ECMAScript Internationalization API (e.g. \"en\", \"en-GB\")" ;
62+ if ( Intl && Intl . Locale ) {
63+ try {
64+ languageIntlLocale = new Intl . Locale ( language ) . language ;
65+ } catch ( e ) {
66+ throw "use accepted language code provided by ECMAScript Internationalization API (e.g. \"en\", \"en-GB\")" ;
67+ }
68+ } else {
69+ languageIntlLocale = language ;
6670 }
6771 if ( languageIntlLocale && languageIntlLocale . length !== 2 ) {
6872 throw "use 2-char/4-char language code (e.g. \"en\", \"en-GB\")" ;
You can’t perform that action at this time.
0 commit comments