mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-05-07 14:56:06 +02:00
feat(localization): add vr.pug
This commit is contained in:
@@ -1360,5 +1360,17 @@
|
|||||||
"count": "Count",
|
"count": "Count",
|
||||||
"action": "Action"
|
"action": "Action"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"vr": {
|
||||||
|
"status": {
|
||||||
|
"timer": "Timer:",
|
||||||
|
"players": "Players:",
|
||||||
|
"cpu": "CPU:",
|
||||||
|
"online": "Online:",
|
||||||
|
"devices": {
|
||||||
|
"left": "L:",
|
||||||
|
"right": "R:"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1360,5 +1360,17 @@
|
|||||||
"count": "次數",
|
"count": "次數",
|
||||||
"action": "動作"
|
"action": "動作"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"vr": {
|
||||||
|
"status": {
|
||||||
|
"timer": "時長:",
|
||||||
|
"players": "玩家人數:",
|
||||||
|
"cpu": "CPU:",
|
||||||
|
"online": "線上:",
|
||||||
|
"devices": {
|
||||||
|
"left": "左:",
|
||||||
|
"right": "右:"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,10 +8,12 @@ import '@fontsource/noto-sans-kr';
|
|||||||
import '@fontsource/noto-sans-jp';
|
import '@fontsource/noto-sans-jp';
|
||||||
import Noty from 'noty';
|
import Noty from 'noty';
|
||||||
import Vue from 'vue';
|
import Vue from 'vue';
|
||||||
|
import VueI18n from 'vue-i18n';
|
||||||
import ElementUI from 'element-ui';
|
import ElementUI from 'element-ui';
|
||||||
import locale from 'element-ui/lib/locale/lang/en';
|
import locale from 'element-ui/lib/locale/lang/en';
|
||||||
import * as workerTimers from 'worker-timers';
|
import * as workerTimers from 'worker-timers';
|
||||||
import MarqueeText from 'vue-marquee-text-component';
|
import MarqueeText from 'vue-marquee-text-component';
|
||||||
|
import * as localizedStrings from './localization/localizedStrings.js';
|
||||||
Vue.component('marquee-text', MarqueeText);
|
Vue.component('marquee-text', MarqueeText);
|
||||||
|
|
||||||
(async function () {
|
(async function () {
|
||||||
@@ -29,6 +31,14 @@ Vue.component('marquee-text', MarqueeText);
|
|||||||
timeout: 3000
|
timeout: 3000
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Vue.use(VueI18n);
|
||||||
|
|
||||||
|
var i18n = new VueI18n({
|
||||||
|
locale: 'en',
|
||||||
|
fallbackLocale: 'en',
|
||||||
|
messages: localizedStrings
|
||||||
|
});
|
||||||
|
|
||||||
Vue.use(ElementUI, {
|
Vue.use(ElementUI, {
|
||||||
locale
|
locale
|
||||||
});
|
});
|
||||||
@@ -163,6 +173,7 @@ Vue.component('marquee-text', MarqueeText);
|
|||||||
};
|
};
|
||||||
|
|
||||||
var $app = {
|
var $app = {
|
||||||
|
i18n,
|
||||||
data: {
|
data: {
|
||||||
// 1 = 대시보드랑 손목에 보이는거
|
// 1 = 대시보드랑 손목에 보이는거
|
||||||
// 2 = 항상 화면에 보이는 거
|
// 2 = 항상 화면에 보이는 거
|
||||||
@@ -675,6 +686,38 @@ Vue.component('marquee-text', MarqueeText);
|
|||||||
Vue.filter('formatDate', formatDate);
|
Vue.filter('formatDate', formatDate);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// App: Language
|
||||||
|
|
||||||
|
$app.data.appLanguage = 'en';
|
||||||
|
/*
|
||||||
|
if (configRepository.getString('VRCX_appLanguage')) {
|
||||||
|
$app.data.appLanguage = configRepository.getString('VRCX_appLanguage');
|
||||||
|
i18n.locale = $app.data.appLanguage;
|
||||||
|
} else {
|
||||||
|
AppApi.CurrentLanguage().then((result) => {
|
||||||
|
if (!result) {
|
||||||
|
console.error('Failed to get current language');
|
||||||
|
$app.changeAppLanguage('en');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
var lang = result.split('-')[0];
|
||||||
|
i18n.availableLocales.forEach((ref) => {
|
||||||
|
var refLang = ref.split('_')[0];
|
||||||
|
if (refLang === lang) {
|
||||||
|
$app.changeAppLanguage(ref);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
$app.methods.changeAppLanguage = function (language) {
|
||||||
|
console.log('Language changed:', language);
|
||||||
|
this.appLanguage = language;
|
||||||
|
i18n.locale = language;
|
||||||
|
configRepository.setString('VRCX_appLanguage', language);
|
||||||
|
};
|
||||||
|
*/
|
||||||
|
|
||||||
$app = new Vue($app);
|
$app = new Vue($app);
|
||||||
window.$app = $app;
|
window.$app = $app;
|
||||||
})();
|
})();
|
||||||
|
|||||||
+16
-16
@@ -30,14 +30,14 @@ html
|
|||||||
.detail
|
.detail
|
||||||
span.extra
|
span.extra
|
||||||
span.time {{ feed.created_at | formatDate }}
|
span.time {{ feed.created_at | formatDate }}
|
||||||
| #[span.name(v-text="feed.displayName")] ✔
|
| #[span.name(v-text="feed.displayName")] ✔
|
||||||
template(v-if="feed.worldName")
|
template(v-if="feed.worldName")
|
||||||
| #[location(:location="feed.location" :hint="feed.worldName")]
|
| #[location(:location="feed.location" :hint="feed.worldName")]
|
||||||
div(v-else-if="feed.type === 'Status'" class="x-friend-item" :class="{ friend: feed.isFriend, favorite: feed.isFavorite }")
|
div(v-else-if="feed.type === 'Status'" class="x-friend-item" :class="{ friend: feed.isFriend, favorite: feed.isFavorite }")
|
||||||
.detail
|
.detail
|
||||||
span.extra
|
span.extra
|
||||||
span.time {{ feed.created_at | formatDate }}
|
span.time {{ feed.created_at | formatDate }}
|
||||||
| #[span.name(v-text="feed.displayName")]
|
| #[span.name(v-text="feed.displayName")]
|
||||||
template(v-if="feed.statusDescription === feed.previousStatusDescription")
|
template(v-if="feed.statusDescription === feed.previousStatusDescription")
|
||||||
i.x-user-status(:class="statusClass(feed.previousStatus)")
|
i.x-user-status(:class="statusClass(feed.previousStatus)")
|
||||||
i.el-icon-right
|
i.el-icon-right
|
||||||
@@ -69,7 +69,7 @@ html
|
|||||||
.detail
|
.detail
|
||||||
span.extra
|
span.extra
|
||||||
span.time {{ feed.created_at | formatDate }}
|
span.time {{ feed.created_at | formatDate }}
|
||||||
| 🎵 #[span.name(v-text="feed.displayName")]
|
| 🎵 #[span.name(v-text="feed.displayName")]
|
||||||
template(v-if="feed.videoName")
|
template(v-if="feed.videoName")
|
||||||
| #[span(v-text="feed.videoName")]
|
| #[span(v-text="feed.videoName")]
|
||||||
template(v-else)
|
template(v-else)
|
||||||
@@ -144,7 +144,7 @@ html
|
|||||||
span.extra
|
span.extra
|
||||||
span.time {{ feed.created_at | formatDate }}
|
span.time {{ feed.created_at | formatDate }}
|
||||||
template(v-if="feed.displayName")
|
template(v-if="feed.displayName")
|
||||||
| ✨ #[span.name(v-text="feed.displayName")]
|
| ✨ #[span.name(v-text="feed.displayName")]
|
||||||
| #[location(:location="feed.instanceId" :hint="feed.worldName")]
|
| #[location(:location="feed.instanceId" :hint="feed.worldName")]
|
||||||
template(v-else)
|
template(v-else)
|
||||||
| ✨ User has spawned a portal
|
| ✨ User has spawned a portal
|
||||||
@@ -152,7 +152,7 @@ html
|
|||||||
.detail
|
.detail
|
||||||
span.extra
|
span.extra
|
||||||
span.time {{ feed.created_at | formatDate }}
|
span.time {{ feed.created_at | formatDate }}
|
||||||
| 🧍 #[span.name(v-text="feed.displayName")]
|
| 🧍 #[span.name(v-text="feed.displayName")]
|
||||||
template(v-if="feed.releaseStatus === 'public'")
|
template(v-if="feed.releaseStatus === 'public'")
|
||||||
| #[i.x-user-status.online]
|
| #[i.x-user-status.online]
|
||||||
template(v-else)
|
template(v-else)
|
||||||
@@ -229,14 +229,14 @@ html
|
|||||||
.detail
|
.detail
|
||||||
span.extra
|
span.extra
|
||||||
span.time {{ feed.created_at | formatDate }}
|
span.time {{ feed.created_at | formatDate }}
|
||||||
| #[span.name(v-text="feed.displayName")] has logged in
|
| #[span.name(v-text="feed.displayName")] has logged in
|
||||||
template(v-if="feed.worldName")
|
template(v-if="feed.worldName")
|
||||||
| to #[location(:location="feed.location" :hint="feed.worldName")]
|
| to #[location(:location="feed.location" :hint="feed.worldName")]
|
||||||
div(v-else-if="feed.type === 'Status'" class="x-friend-item" :class="{ friend: feed.isFriend, favorite: feed.isFavorite }")
|
div(v-else-if="feed.type === 'Status'" class="x-friend-item" :class="{ friend: feed.isFriend, favorite: feed.isFavorite }")
|
||||||
.detail
|
.detail
|
||||||
span.extra
|
span.extra
|
||||||
span.time {{ feed.created_at | formatDate }}
|
span.time {{ feed.created_at | formatDate }}
|
||||||
| #[span.name(v-text="feed.displayName")]
|
| #[span.name(v-text="feed.displayName")]
|
||||||
template(v-if="feed.statusDescription === feed.previousStatusDescription")
|
template(v-if="feed.statusDescription === feed.previousStatusDescription")
|
||||||
i.x-user-status(:class="statusClass(feed.previousStatus)")
|
i.x-user-status(:class="statusClass(feed.previousStatus)")
|
||||||
i.el-icon-right
|
i.el-icon-right
|
||||||
@@ -267,7 +267,7 @@ html
|
|||||||
.detail
|
.detail
|
||||||
span.extra
|
span.extra
|
||||||
span.time {{ feed.created_at | formatDate }}
|
span.time {{ feed.created_at | formatDate }}
|
||||||
| #[span.name(v-text="feed.displayName")] changed video to
|
| #[span.name(v-text="feed.displayName")] changed video to
|
||||||
template(v-if="feed.videoName")
|
template(v-if="feed.videoName")
|
||||||
| #[span(v-text="feed.videoName")]
|
| #[span(v-text="feed.videoName")]
|
||||||
template(v-else)
|
template(v-else)
|
||||||
@@ -342,7 +342,7 @@ html
|
|||||||
span.extra
|
span.extra
|
||||||
span.time {{ feed.created_at | formatDate }}
|
span.time {{ feed.created_at | formatDate }}
|
||||||
template(v-if="feed.displayName")
|
template(v-if="feed.displayName")
|
||||||
| #[span.name(v-text="feed.displayName")] has spawned a portal to
|
| #[span.name(v-text="feed.displayName")] has spawned a portal to
|
||||||
| #[location(:location="feed.instanceId" :hint="feed.worldName")]
|
| #[location(:location="feed.instanceId" :hint="feed.worldName")]
|
||||||
template(v-else)
|
template(v-else)
|
||||||
| User has spawned a portal
|
| User has spawned a portal
|
||||||
@@ -350,7 +350,7 @@ html
|
|||||||
.detail
|
.detail
|
||||||
span.extra
|
span.extra
|
||||||
span.time {{ feed.created_at | formatDate }}
|
span.time {{ feed.created_at | formatDate }}
|
||||||
| #[span.name(v-text="feed.displayName")] changed into avatar
|
| #[span.name(v-text="feed.displayName")] changed into avatar
|
||||||
template(v-if="feed.releaseStatus === 'public'")
|
template(v-if="feed.releaseStatus === 'public'")
|
||||||
| #[i.x-user-status.online]
|
| #[i.x-user-status.online]
|
||||||
template(v-else)
|
template(v-else)
|
||||||
@@ -423,13 +423,13 @@ html
|
|||||||
img(v-else-if="device[2] < 20" src="images/controller_status_ready_low.png" style="width:32px;height:32px")
|
img(v-else-if="device[2] < 20" src="images/controller_status_ready_low.png" style="width:32px;height:32px")
|
||||||
img(v-else src="images/controller_status_ready.png" style="width:32px;height:32px")
|
img(v-else src="images/controller_status_ready.png" style="width:32px;height:32px")
|
||||||
br
|
br
|
||||||
span L:{{ device[2] }}%
|
span {{ $t('vr.status.devices.left') }}{{ device[2] }}%
|
||||||
template(v-else-if="device[0] === 'rightController'")
|
template(v-else-if="device[0] === 'rightController'")
|
||||||
img(v-if="device[1] !== 'connected'" src="images/controller_status_off.png" style="width:32px;height:32px")
|
img(v-if="device[1] !== 'connected'" src="images/controller_status_off.png" style="width:32px;height:32px")
|
||||||
img(v-else-if="device[2] < 20" src="images/controller_status_ready_low.png" style="width:32px;height:32px")
|
img(v-else-if="device[2] < 20" src="images/controller_status_ready_low.png" style="width:32px;height:32px")
|
||||||
img(v-else src="images/controller_status_ready.png" style="width:32px;height:32px")
|
img(v-else src="images/controller_status_ready.png" style="width:32px;height:32px")
|
||||||
br
|
br
|
||||||
span R:{{ device[2] }}%
|
span {{ $t('vr.status.devices.right') }}{{ device[2] }}%
|
||||||
template(v-else-if="device[0] === 'controller'")
|
template(v-else-if="device[0] === 'controller'")
|
||||||
img(v-if="device[1] !== 'connected'" src="images/controller_status_off.png" style="width:32px;height:32px")
|
img(v-if="device[1] !== 'connected'" src="images/controller_status_off.png" style="width:32px;height:32px")
|
||||||
img(v-else-if="device[2] < 20" src="images/controller_status_ready_low.png" style="width:32px;height:32px")
|
img(v-else-if="device[2] < 20" src="images/controller_status_ready_low.png" style="width:32px;height:32px")
|
||||||
@@ -463,17 +463,17 @@ html
|
|||||||
span(style="display:inline-block") {{ lastLocation.playerList.length }}
|
span(style="display:inline-block") {{ lastLocation.playerList.length }}
|
||||||
span(style="display:inline-block;font-weight:bold") {{ lastLocation.friendList.length !== 0 ? ` (${lastLocation.friendList.length})` : ''}}
|
span(style="display:inline-block;font-weight:bold") {{ lastLocation.friendList.length !== 0 ? ` (${lastLocation.friendList.length})` : ''}}
|
||||||
template(v-else)
|
template(v-else)
|
||||||
span(style="float:right") Timer: {{ lastLocationTimer }}
|
span(style="float:right") {{ $t('vr.status.timer') }} {{ lastLocationTimer }}
|
||||||
template(v-if="onlineForTimer")
|
template(v-if="onlineForTimer")
|
||||||
| / {{ onlineForTimer }}
|
| / {{ onlineForTimer }}
|
||||||
template(v-if="pcUptime")
|
template(v-if="pcUptime")
|
||||||
| / {{ pcUptime }}
|
| / {{ pcUptime }}
|
||||||
span(style="display:inline-block") Players: {{ lastLocation.playerList.length }}
|
span(style="display:inline-block") {{ $t('vr.status.players') }} {{ lastLocation.playerList.length }}
|
||||||
span(style="display:inline-block;font-weight:bold") {{ lastLocation.friendList.length !== 0 ? ` (${lastLocation.friendList.length})` : ''}}
|
span(style="display:inline-block;font-weight:bold") {{ lastLocation.friendList.length !== 0 ? ` (${lastLocation.friendList.length})` : ''}}
|
||||||
br
|
br
|
||||||
span(style="float:right") {{ currentTime }}
|
span(style="float:right") {{ currentTime }}
|
||||||
span(v-if="config && !config.hideCpuUsageFromFeed" style="display:inline-block;margin-right:5px") CPU: {{ cpuUsage }}%
|
span(v-if="config && !config.hideCpuUsageFromFeed" style="display:inline-block;margin-right:5px") {{ $t('vr.status.cpu') }} {{ cpuUsage }}%
|
||||||
span(style="display:inline-block") Online: {{ onlineFriendCount }}
|
span(style="display:inline-block") {{ $t('vr.status.online') }} {{ onlineFriendCount }}
|
||||||
template(v-else)
|
template(v-else)
|
||||||
svg(class="np-progress-circle")
|
svg(class="np-progress-circle")
|
||||||
circle(class="np-progress-circle-stroke" cx="60" cy="60" stroke="white" r="30" fill="transparent" stroke-width="60")
|
circle(class="np-progress-circle-stroke" cx="60" cy="60" stroke="white" r="30" fill="transparent" stroke-width="60")
|
||||||
|
|||||||
Reference in New Issue
Block a user