hackchat-engine 1.1.27 → 1.1.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Client.js +14 -0
- package/package.json +1 -1
package/Client.js
CHANGED
|
@@ -384,11 +384,25 @@ class Client extends EventEmitter {
|
|
|
384
384
|
const requestDomain = domain
|
|
385
385
|
|| (typeof window !== 'undefined' && window.location ? window.location.host : 'hack.chat');
|
|
386
386
|
|
|
387
|
+
let locale = 'en';
|
|
388
|
+
try {
|
|
389
|
+
if (typeof navigator !== 'undefined' && navigator.language) {
|
|
390
|
+
locale = navigator.language;
|
|
391
|
+
} else if (typeof Intl !== 'undefined') {
|
|
392
|
+
locale = Intl.DateTimeFormat().resolvedOptions().locale;
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
locale = locale.split('-')[0].toLowerCase();
|
|
396
|
+
} catch (err) {
|
|
397
|
+
locale = 'en';
|
|
398
|
+
}
|
|
399
|
+
|
|
387
400
|
this.ws.send({
|
|
388
401
|
cmd: OPCodes.REQUEST_SIW,
|
|
389
402
|
wallet,
|
|
390
403
|
address,
|
|
391
404
|
domain: requestDomain,
|
|
405
|
+
locale,
|
|
392
406
|
});
|
|
393
407
|
}
|
|
394
408
|
|
package/package.json
CHANGED