latest dev + i18n
This commit is contained in:
@@ -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 "";
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user