translations within jscript

Signed-off-by: Peter Siegmund <developer@mars3142.org>
This commit is contained in:
2026-04-11 20:00:42 +02:00
parent 39a9c32a81
commit 6c0225061a
4 changed files with 11 additions and 8 deletions
+2 -2
View File
@@ -106,7 +106,7 @@ class GiteaPRAction extends ActionBase {
// Label — top
ctx.fillStyle = '#7ec8e3';
ctx.font = 'bold 22px "Source Han Sans SC"';
ctx.fillText('Pull Requests', 98, 30);
ctx.fillText(this.$UD.t('Pull Requests'), 98, 30);
if (count === null) {
ctx.fillStyle = isError ? '#ff6b6b' : '#888888';
@@ -117,7 +117,7 @@ class GiteaPRAction extends ActionBase {
ctx.textBaseline = 'middle';
ctx.fillStyle = isError ? '#ff6b6b' : '#888888';
ctx.font = 'bold 22px "Source Han Sans SC"';
ctx.fillText(isError ? 'API Error' : 'Offline', 98, 166);
ctx.fillText(isError ? this.$UD.t('API Error') : this.$UD.t('Offline'), 98, 166);
} else {
const filter = this.config.filter || 'review_requested';
const label = filter === 'assigned' ? 'assigned' : filter === 'review_requested' ? 'review req.' : 'open';
+5 -5
View File
@@ -123,9 +123,9 @@ class ModelRailwayAction extends ActionBase {
modeLabel(mode) {
switch (mode) {
case 'day': return 'Tag';
case 'night': return 'Nacht';
case 'simulation': return 'Simulation';
case 'day': return this.$UD.t('Day');
case 'night': return this.$UD.t('Night');
case 'simulation': return this.$UD.t('Simulation');
default: return mode || '---';
}
}
@@ -160,11 +160,11 @@ class ModelRailwayAction extends ActionBase {
if (!connected) {
ctx.fillStyle = '#ff6b6b';
ctx.font = '22px "Source Han Sans SC"';
ctx.fillText(this.config.host ? 'Verbinde…' : 'Kein Host', 98, 162);
ctx.fillText(this.config.host ? this.$UD.t('Connecting…') : this.$UD.t('No Host'), 98, 162);
} else if (!this.lightOn) {
ctx.fillStyle = '#888888';
ctx.font = '26px "Source Han Sans SC"';
ctx.fillText('Aus', 98, 162);
ctx.fillText(this.$UD.t('Off'), 98, 162);
} else {
ctx.fillStyle = this.modeColor(this.mode);
ctx.font = '24px "Source Han Sans SC"';
+1 -1
View File
@@ -91,7 +91,7 @@ class PetrolAction extends ActionBase {
ctx.fillStyle = '#888888';
ctx.font = '22px "Source Han Sans SC"';
ctx.fillText('Last Rised', 98, 143);
ctx.fillText(this.$UD.t('Last Rised'), 98, 143);
ctx.fillStyle = '#ff6b6b';
ctx.font = 'bold 30px "Source Han Sans SC"';
ctx.fillText(`${lastRised.toFixed(3)}`, 98, 168);
+3
View File
@@ -3,6 +3,9 @@ const ACTION_CACHES = {};
$UD.connect('dev.mars3142.ulanzideck.collection');
$UD.onConnected(() => {
console.log('app.js onConnected');
Utils.readJson(`${Utils.getPluginPath()}/${$UD.language}.json`)
.then(json => { $UD.localization = json['Localization'] || null; })
.catch(() => {});
});
$UD.onAdd(jsn => {