@@ -75,31 +75,8 @@ interface INavigator {
75
75
}
76
76
declare const navigator : INavigator ;
77
77
78
- // Web environment
79
- if ( typeof navigator === 'object' && ! isElectronRenderer ) {
80
- _userAgent = navigator . userAgent ;
81
- _isWindows = _userAgent . indexOf ( 'Windows' ) >= 0 ;
82
- _isMacintosh = _userAgent . indexOf ( 'Macintosh' ) >= 0 ;
83
- _isIOS = ( _userAgent . indexOf ( 'Macintosh' ) >= 0 || _userAgent . indexOf ( 'iPad' ) >= 0 || _userAgent . indexOf ( 'iPhone' ) >= 0 ) && ! ! navigator . maxTouchPoints && navigator . maxTouchPoints > 0 ;
84
- _isLinux = _userAgent . indexOf ( 'Linux' ) >= 0 ;
85
- _isMobile = _userAgent ?. indexOf ( 'Mobi' ) >= 0 ;
86
- _isWeb = true ;
87
-
88
- const configuredLocale = nls . getConfiguredDefaultLocale (
89
- // This call _must_ be done in the file that calls `nls.getConfiguredDefaultLocale`
90
- // to ensure that the NLS AMD Loader plugin has been loaded and configured.
91
- // This is because the loader plugin decides what the default locale is based on
92
- // how it's able to resolve the strings.
93
- nls . localize ( { key : 'ensureLoaderPluginIsLoaded' , comment : [ '{Locked}' ] } , '_' )
94
- ) ;
95
-
96
- _locale = configuredLocale || LANGUAGE_DEFAULT ;
97
- _language = _locale ;
98
- _platformLocale = navigator . language ;
99
- }
100
-
101
78
// Native environment
102
- else if ( typeof nodeProcess === 'object' ) {
79
+ if ( typeof nodeProcess === 'object' ) {
103
80
_isWindows = ( nodeProcess . platform === 'win32' ) ;
104
81
_isMacintosh = ( nodeProcess . platform === 'darwin' ) ;
105
82
_isLinux = ( nodeProcess . platform === 'linux' ) ;
@@ -124,6 +101,29 @@ else if (typeof nodeProcess === 'object') {
124
101
_isNative = true ;
125
102
}
126
103
104
+ // Web environment
105
+ else if ( typeof navigator === 'object' && ! isElectronRenderer ) {
106
+ _userAgent = navigator . userAgent ;
107
+ _isWindows = _userAgent . indexOf ( 'Windows' ) >= 0 ;
108
+ _isMacintosh = _userAgent . indexOf ( 'Macintosh' ) >= 0 ;
109
+ _isIOS = ( _userAgent . indexOf ( 'Macintosh' ) >= 0 || _userAgent . indexOf ( 'iPad' ) >= 0 || _userAgent . indexOf ( 'iPhone' ) >= 0 ) && ! ! navigator . maxTouchPoints && navigator . maxTouchPoints > 0 ;
110
+ _isLinux = _userAgent . indexOf ( 'Linux' ) >= 0 ;
111
+ _isMobile = _userAgent ?. indexOf ( 'Mobi' ) >= 0 ;
112
+ _isWeb = true ;
113
+
114
+ const configuredLocale = nls . getConfiguredDefaultLocale (
115
+ // This call _must_ be done in the file that calls `nls.getConfiguredDefaultLocale`
116
+ // to ensure that the NLS AMD Loader plugin has been loaded and configured.
117
+ // This is because the loader plugin decides what the default locale is based on
118
+ // how it's able to resolve the strings.
119
+ nls . localize ( { key : 'ensureLoaderPluginIsLoaded' , comment : [ '{Locked}' ] } , '_' )
120
+ ) ;
121
+
122
+ _locale = configuredLocale || LANGUAGE_DEFAULT ;
123
+ _language = _locale ;
124
+ _platformLocale = navigator . language ;
125
+ }
126
+
127
127
// Unknown environment
128
128
else {
129
129
console . error ( 'Unable to resolve platform.' ) ;
0 commit comments