iobroker.mywebui 1.37.56 → 1.37.57
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/io-package.json
CHANGED
package/package.json
CHANGED
|
@@ -87,6 +87,10 @@ export class IobrokerHandler {
|
|
|
87
87
|
try { this.userName = await this.connection.getCurrentUser(); } catch (e) {}
|
|
88
88
|
let cfg = await this._getConfig();
|
|
89
89
|
this.config = cfg ?? { globalStyle: null, globalScript: null, globalConfig: null, fontDeclarations: null };
|
|
90
|
+
try {
|
|
91
|
+
const adapterObj = await this.connection.getObject('system.adapter.mywebui.0');
|
|
92
|
+
this.grafanaLangSyncEnabled = !!(adapterObj?.native?.grafanaEnabled && adapterObj?.native?.grafanaLangSyncEnabled);
|
|
93
|
+
} catch (e) { this.grafanaLangSyncEnabled = false; }
|
|
90
94
|
if (this.config.globalConfig == null) {
|
|
91
95
|
this.config.globalConfig = {
|
|
92
96
|
headerTags: `<meta name="apple-mobile-web-app-capable" content="yes" />
|
|
@@ -507,12 +511,14 @@ export class IobrokerHandler {
|
|
|
507
511
|
// Keep local_language in sync so bindings/formulas can read current language
|
|
508
512
|
if (this.#localValues.get('local_language')?.val !== lang)
|
|
509
513
|
this.setState('local_language', { val: lang });
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
514
|
+
if (this.grafanaLangSyncEnabled) {
|
|
515
|
+
fetch('/mywebui-grafana-lang', {
|
|
516
|
+
method: 'POST',
|
|
517
|
+
headers: { 'Content-Type': 'application/json' },
|
|
518
|
+
credentials: 'include',
|
|
519
|
+
body: JSON.stringify({ lang })
|
|
520
|
+
}).catch(() => {});
|
|
521
|
+
}
|
|
516
522
|
}
|
|
517
523
|
/** Translation helper - hər yerdən istifadə üçün
|
|
518
524
|
* iobrokerHandler.t('pid.op')
|