Fix overlay language

This commit is contained in:
Natsumi
2026-01-06 18:40:02 +13:00
parent 3a72d03f9e
commit 35ddf5ddd0
3 changed files with 19 additions and 15 deletions

View File

@@ -1,21 +1,25 @@
import { import {
changeAppDarkStyle, changeAppDarkStyle,
changeAppThemeStyle, changeAppThemeStyle,
changeHtmlLangAttribute,
getThemeMode, getThemeMode,
refreshCustomCss, refreshCustomCss,
setLoginContainerStyle setLoginContainerStyle
} from '../shared/utils/base/ui'; } from '../shared/utils/base/ui';
import { i18n } from './i18n'; import { i18n, loadLocalizedStrings } from './i18n';
import configRepository from '../service/config'; import configRepository from '../service/config';
export async function initUi() { export async function initUi() {
try { try {
// @ts-ignore const language = await configRepository.getString(
i18n.locale = await configRepository.getString(
'VRCX_appLanguage', 'VRCX_appLanguage',
'en' 'en'
); );
// @ts-ignore
i18n.locale = language;
await loadLocalizedStrings(language);
changeHtmlLangAttribute(language);
const { initThemeMode, isDarkMode } = const { initThemeMode, isDarkMode } =
await getThemeMode(configRepository); await getThemeMode(configRepository);

View File

@@ -1248,7 +1248,9 @@
:style="{ width: nowPlaying.percentage + '%' }"></div> :style="{ width: nowPlaying.percentage + '%' }"></div>
</template> </template>
<div style="float: right"> <div style="float: right">
<span v-if="!config?.minimalFeed" style="display: inline-block">{{ t('vr.status.timer') }}</span> <span v-if="!config?.minimalFeed" style="display: inline-block; margin-right: 5px">{{
t('vr.status.timer')
}}</span>
<span v-if="lastLocationTimer" style="display: inline-block; margin-right: 5px">{{ <span v-if="lastLocationTimer" style="display: inline-block; margin-right: 5px">{{
lastLocationTimer lastLocationTimer
}}</span> }}</span>
@@ -1262,7 +1264,9 @@
<span v-if="pcUptime" style="display: inline-block; margin-left: 5px">{{ pcUptime }}</span> <span v-if="pcUptime" style="display: inline-block; margin-left: 5px">{{ pcUptime }}</span>
</div> </div>
<template v-if="lastLocation.playerList.length"> <template v-if="lastLocation.playerList.length">
<span v-if="!config?.minimalFeed" style="display: inline-block">{{ t('vr.status.players') }}</span> <span v-if="!config?.minimalFeed" style="display: inline-block; margin-right: 5px">{{
t('vr.status.players')
}}</span>
<span style="display: inline-block">{{ lastLocation.playerList.length }}</span> <span style="display: inline-block">{{ lastLocation.playerList.length }}</span>
</template> </template>
<span <span
@@ -1430,9 +1434,7 @@
name: 'vr' name: 'vr'
}); });
const i18n = useI18n(); const { t, locale } = useI18n();
const { t } = i18n;
const vrState = reactive({ const vrState = reactive({
appType: new URLSearchParams(window.location.search).has('wrist') ? 'wrist' : 'hmd', appType: new URLSearchParams(window.location.search).has('wrist') ? 'wrist' : 'hmd',
@@ -2099,14 +2101,11 @@
if (!appLanguage) { if (!appLanguage) {
return; return;
} }
if (appLanguage !== vrState.appLanguage) { vrState.appLanguage = appLanguage;
vrState.appLanguage = appLanguage;
await loadLocalizedStrings(appLanguage); await loadLocalizedStrings(appLanguage);
changeHtmlLangAttribute(vrState.appLanguage); changeHtmlLangAttribute(vrState.appLanguage);
//@ts-ignore locale.value = vrState.appLanguage;
i18n.locale = vrState.appLanguage;
}
} }
function trackingResultToClass(deviceStatus) { function trackingResultToClass(deviceStatus) {

View File

@@ -467,6 +467,7 @@ i.x-user-status.busy {
} }
.tracker-device img { .tracker-device img {
display: inline-block;
height: 32px; height: 32px;
transition: all 0.25s linear; transition: all 0.25s linear;
} }