latest dev + i18n

This commit is contained in:
_Bastler
2022-01-27 13:03:59 +01:00
parent e3b58a0d56
commit 7e987ad470
12 changed files with 70 additions and 34 deletions
@@ -1,6 +1,8 @@
<script lang="ts">
import { layoutManagerActionStore } from "../../Stores/LayoutManagerStore";
import { HtmlUtils } from "../../WebRtc/HtmlUtils";
import { i18nJson } from "../../i18n/locales";
function onClick(callback: () => void) {
callback();
@@ -8,20 +10,7 @@
function i18n(text: string | number | boolean | undefined): string {
if (typeof text === "string") {
if (text.trim().startsWith("{")) {
try {
let textObject = JSON.parse(text);
if (textObject[$locale]) {
return textObject[$locale];
} else if (Object.keys(textObject).length > 0) {
// fallback to first value
return textObject[Object.keys(textObject)[0]];
}
} catch (err) {
//
}
}
return text;
return i18nJson(text);
}
return "";
}
+1 -1
View File
@@ -34,5 +34,5 @@
<SoundMeterWidget {stream} />
{/if}
</div>
<div class="is-silent" class:hide={isSilent}>{$LL.camera.my.silentZone()}</div>
<div class="nes-container is-dark is-silent" class:hide={isSilent}>{$LL.camera.my.silentZone()}</div>
</div>