fix sonar findings and translation structure
Sonarqube Scanner / Prepare environment (push) Successful in 19s
Sonarqube Scanner / Build and test (push) Successful in 43s
Sonarqube Scanner / SonarQube analysis (push) Failing after 2m28s
Sonarqube Scanner / Deploy to Server (push) Successful in 16s

This commit is contained in:
Florian Zumpe
2026-10-01 16:31:46 +02:00
parent 2b42507f13
commit 5c4d20bd1d
30 changed files with 1753 additions and 894 deletions
+43 -43
View File
@@ -58,7 +58,7 @@
if (state.routeState === 'paused') {
$('#tracking-status')
.prop('hidden', false)
.text(ns.I18n.t("app.du.kannst.dort.weitermachen.wo.du.aufgehort"));
.text(ns.I18n.t("app.resume-hint"));
} else {
$('#tracking-status').prop('hidden', true).text('');
}
@@ -115,7 +115,7 @@
const proximity = route.proximityM == null
? ''
: `<small>${escapeHtml(ns.Distance.format(route.proximityM))} entfernt</small>`;
const sourceLabel = source === 'local' ? ("<small>" + escapeHtml(ns.I18n.t("app.eigener.entwurf")) + "</small>") : '';
const sourceLabel = source === 'local' ? ("<small>" + escapeHtml(ns.I18n.t("app.draft")) + "</small>") : '';
return `
<li>
<button type="button" data-route-select data-route-id="${escapeHtml(route.id)}" data-route-source="${source}">
@@ -157,21 +157,21 @@
function updateRouteControlSummary() {
if (!state.route) {
setRouteControlSummary(ns.I18n.t("app.strecke.wahlen"), ns.I18n.t("app.strecken.fur.alle.und.meine.entwurfe"));
setRouteControlSummary(ns.I18n.t("app.choose-route"), ns.I18n.t("app.route-menu"));
return;
}
const titleText = state.route.name || ns.I18n.t("app.strecke");
const titleText = state.route.name || ns.I18n.t("app.route");
const metric = nextPoiMetric();
if (!metric) {
const detailText = (state.route.pois || []).length
? ns.I18n.t("app.alle.stationen.erreicht")
: ns.I18n.t("app.keine.stationen.vorhanden");
? ns.I18n.t("app.stations-complete")
: ns.I18n.t("app.no-stations");
setRouteControlSummary(titleText, detailText);
return;
}
const distance = metric.distance == null ? '' : ` · ${Math.round(metric.distance)} m`;
setRouteControlSummary(titleText, ns.I18n.t("app.nachste.station", { value1: metric.poi.title, value2: distance }));
setRouteControlSummary(titleText, ns.I18n.t("app.next-station-summary", { value1: metric.poi.title, value2: distance }));
}
function renderRouteControlList(selector, routes, source, emptyText) {
@@ -187,7 +187,7 @@
<li>
<button type="button" data-route-select data-route-id="${escapeHtml(route.id)}" data-route-source="${source}" ${current ? 'aria-current="true"' : ''}>
<strong>${escapeHtml(route.name)}</strong>
<small>${source === 'local' ? ns.I18n.t("app.eigener.entwurf") : ns.I18n.t("app.veroffentlicht")}</small>
<small>${source === 'local' ? ns.I18n.t("app.draft") : ns.I18n.t("app.published")}</small>
</button>
</li>
`);
@@ -198,22 +198,22 @@
const routeControlLists = $('.route-control-list');
routeControlLists.attr('aria-busy', 'true');
$('#route-control-server-title').text(ns.I18n.t("app.strecken.fur.alle", { value1: state.routes.length }));
$('#route-control-local-title').text(ns.I18n.t("app.meine.entwurfe", { value1: state.localRoutes.length }));
$('#local-route-title').text(ns.I18n.t("app.meine.entwurfe", { value1: state.localRoutes.length }));
$('#route-control-server-title').text(ns.I18n.t("app.public-route-count", { value1: state.routes.length }));
$('#route-control-local-title').text(ns.I18n.t("app.draft-count", { value1: state.localRoutes.length }));
$('#local-route-title').text(ns.I18n.t("app.draft-count", { value1: state.localRoutes.length }));
updateRouteControlSummary();
renderRouteControlList(
'#route-control-server-list',
state.routes,
'server',
ns.I18n.t("app.hier.gibt.es.noch.keine.strecken.fur")
ns.I18n.t("app.no-public-route")
);
renderRouteControlList(
'#route-control-local-list',
state.localRoutes,
'local',
state.localRoutesError || ns.I18n.t("app.du.hast.noch.keine.eigene.strecke.angelegt")
state.localRoutesError || ns.I18n.t("app.no-route")
);
routeControlLists.attr('aria-busy', 'false');
@@ -239,26 +239,26 @@
.sort((a, b) => String(a.name ?? '').localeCompare(String(b.name ?? ''), 'de'));
const nearbyEmptyText = state.position
? ns.I18n.t("app.keine.strecke.im.umkreis.von.km.gefunden", { value1: ns.Config.routeRadiusKm })
: ns.I18n.t("app.erlaube.deinen.standort.um.strecken.in.deiner");
? ns.I18n.t("app.no-nearby-route", { value1: ns.Config.routeRadiusKm })
: ns.I18n.t("app.location-permission-hint");
renderRouteItems('#nearby-route-list', nearbyRoutes, nearbyEmptyText);
renderRouteItems(
'#all-route-list',
allRoutes,
searchTerm ? ns.I18n.t("app.keine.passende.strecke.gefunden.versuche.ein.anderes") : ns.I18n.t("app.hier.gibt.es.noch.keine.strecken.fur")
searchTerm ? ns.I18n.t("app.no-search-result") : ns.I18n.t("app.no-public-route")
);
renderRouteItems(
'#local-route-list',
localRoutes,
state.localRoutesError || ns.I18n.t("app.du.hast.noch.keine.eigene.strecke.angelegt"),
state.localRoutesError || ns.I18n.t("app.no-route"),
'local'
);
$('#all-routes-summary').text(
searchTerm
? ns.I18n.t("app.von.strecken.gefunden", { value1: allRoutes.length, value2: routes.length })
: ns.I18n.t("app.strecken.zur.auswahl", { value1: routes.length })
? ns.I18n.t("app.search-result-count", { value1: allRoutes.length, value2: routes.length })
: ns.I18n.t("app.route-count", { value1: routes.length })
);
renderRouteControl();
}
@@ -305,7 +305,7 @@
function updateRouteControls() {
const running = state.routeState === 'running';
const paused = state.routeState === 'paused';
const startLabel = paused ? ns.I18n.t("app.strecke.fortsetzen") : ns.I18n.t("app.strecke.starten");
const startLabel = paused ? ns.I18n.t("app.resume-route") : ns.I18n.t("app.start-route");
$('#start-route')
.prop('disabled', running)
.attr({ 'aria-label': startLabel, title: startLabel });
@@ -333,7 +333,7 @@
setActivePoi(null);
hideNavigation();
if (announce && wasActive && !returnToRoutes) {
$('#tracking-status').prop('hidden', false).text(ns.I18n.t("app.strecke.beendet"));
$('#tracking-status').prop('hidden', false).text(ns.I18n.t("app.route-finished"));
} else {
$('#tracking-status').prop('hidden', true).text('');
}
@@ -357,8 +357,8 @@
ns.AudioPlayer.pause();
$('#tracking-status')
.prop('hidden', false)
.text(ns.I18n.t("app.du.machst.eine.pause.die.app.sucht"));
showNavigation(ns.I18n.t("app.strecke.pausiert"), $('#navigation-distance').text() || '–');
.text(ns.I18n.t("app.pause-hint"));
showNavigation(ns.I18n.t("app.route-paused"), $('#navigation-distance').text() || '–');
updateRouteControls();
updateRouteControlSummary();
}
@@ -384,7 +384,7 @@
updateRouteControls();
const list = $('#poi-list').empty();
if (!route.pois.length) {
list.append(("<li><p>" + escapeHtml(ns.I18n.t("app.diese.strecke.hat.noch.keine.stationen")) + "</p></li>"));
list.append(("<li><p>" + escapeHtml(ns.I18n.t("app.empty-route")) + "</p></li>"));
updateRouteControlSummary();
return;
}
@@ -537,13 +537,13 @@
$('#navigation-arrow').css('transform', `rotate(${metric.rotation.toFixed(1)}deg)`);
showNavigation(
heading == null
? ns.I18n.t("app.norden.oben.nachste.station", { value1: metric.poi.title })
: ns.I18n.t("app.nachste.station.2", { value1: metric.poi.title }),
? ns.I18n.t("app.next-station-north", { value1: metric.poi.title })
: ns.I18n.t("app.next-station", { value1: metric.poi.title }),
`${distance} m`
);
$('#navigation-footer').attr(
'aria-label',
ns.I18n.t("app.nachste.station.in.metern", { value1: metric.poi.title, value2: distance })
ns.I18n.t("app.next-station-distance", { value1: metric.poi.title, value2: distance })
);
}
@@ -556,8 +556,8 @@
if (progress.reached) {
$('#navigation-arrow').css('transform', 'rotate(0deg)');
showNavigation(ns.I18n.t("app.alle.stationen.und.das.ziel.erreicht"), '0 m');
$('#navigation-footer').attr('aria-label', ns.I18n.t("app.alle.stationen.und.das.ziel.erreicht"));
showNavigation(ns.I18n.t("app.destination-reached"), '0 m');
$('#navigation-footer').attr('aria-label', ns.I18n.t("app.destination-reached"));
return;
}
const bearing = ns.Distance.bearing(position, progress.target);
@@ -568,12 +568,12 @@
const distance = Math.round(progress.distance);
$('#navigation-arrow').css('transform', `rotate(${rotation.toFixed(1)}deg)`);
showNavigation(
heading == null ? ns.I18n.t("app.norden.oben.nachster.punkt.auf.dem.weg") : ns.I18n.t("app.nachster.punkt.auf.dem.weg"),
heading == null ? ns.I18n.t("app.next-path-point-north") : ns.I18n.t("app.next-path-point"),
`${distance} m`
);
$('#navigation-footer').attr(
'aria-label',
ns.I18n.t("app.nachster.punkt.auf.dem.weg.in.metern", { value1: distance })
ns.I18n.t("app.next-path-point-distance", { value1: distance })
);
}
@@ -608,8 +608,8 @@
const nearest = nearestPendingPoi(metrics);
updateNavigation(position);
$('#tracking-status').text(
ns.I18n.t("app.dein.standort.wird.gesucht.auf.etwa.m", { value1: Math.round(position.accuracy) })
+ (nearest ? ns.I18n.t("app.nachste.station.m", { value1: Math.round(nearest.distance) }) : ns.I18n.t("app.alle.stationen.erreicht.2"))
ns.I18n.t("app.location-accuracy", { value1: Math.round(position.accuracy) })
+ (nearest ? ns.I18n.t("app.nearest-station-distance", { value1: Math.round(nearest.distance) }) : ns.I18n.t("app.stations-complete-suffix"))
);
if (nearest && nearest.distance <= nearest.poi.triggerRadiusM) {
state.triggered.add(nearest.poi.id);
@@ -636,11 +636,11 @@
updateRouteControlSummary();
$('#tracking-status')
.prop('hidden', false)
.text(resumed ? ns.I18n.t("app.strecke.wird.fortgesetzt") : ns.I18n.t("app.location.start"));
showNavigation(resumed ? ns.I18n.t("app.strecke.wird.fortgesetzt.2") : ns.I18n.t("app.location.searching"));
.text(resumed ? ns.I18n.t("app.resuming") : ns.I18n.t("app.location.start"));
showNavigation(resumed ? ns.I18n.t("app.resuming-title") : ns.I18n.t("app.location.searching"));
ns.Geo.start(
evaluatePosition,
() => $('#tracking-status').text(ns.I18n.t("app.dein.standort.konnte.nicht.gefunden.werden.prufe"))
() => $('#tracking-status').text(ns.I18n.t("app.error.location"))
);
const orientationAvailable = await ns.Orientation.start(updateHeading);
@@ -648,12 +648,12 @@
ns.Orientation.stop();
return;
}
if (!orientationAvailable) $('#navigation-mode').text(ns.I18n.t("app.norden.oben.navigation"));
if (!orientationAvailable) $('#navigation-mode').text(ns.I18n.t("app.navigation-north"));
}
function routesFromResponse(response) {
if (!Array.isArray(response?.routes)) {
throw new TypeError(ns.I18n.t("app.die.strecken.konnten.nicht.geladen.werden.bitte"));
throw new TypeError(ns.I18n.t("app.error.load-routes"));
}
return response.routes
.filter(route => route?.id != null && route?.name != null)
@@ -666,7 +666,7 @@
state.localRoutesError = null;
} catch (error) {
state.localRoutes = [];
state.localRoutesError = ns.UserMessages?.error(error, ns.I18n.t("app.deine.entwurfe.konnten.nicht.geoffnet.werden.bitte")) || ns.I18n.t("app.deine.entwurfe.konnten.nicht.geoffnet.werden.bitte");
state.localRoutesError = ns.UserMessages?.error(error, ns.I18n.t("app.error.load-drafts")) || ns.I18n.t("app.error.load-drafts");
}
}
@@ -685,12 +685,12 @@
state.position = position;
updateRouteProximity(position);
$('#location-hint').text(
ns.I18n.t("app.dein.standort.wurde.auf.etwa.m.genau", { value1: Math.round(position.accuracy) })
+ ns.I18n.t("app.wir.zeigen.dir.strecken.bis.km.entfernung", { value1: ns.Config.routeRadiusKm })
ns.I18n.t("app.location-found", { value1: Math.round(position.accuracy) })
+ ns.I18n.t("app.search-radius", { value1: ns.Config.routeRadiusKm })
);
} catch {
$('#location-hint').text(
ns.I18n.t("app.dein.standort.konnte.nicht.gefunden.werden.du")
ns.I18n.t("app.location-optional")
);
} finally {
context.markStep('location', 'done');
@@ -746,7 +746,7 @@
try {
await selectRoute(String(button.data('route-source') || 'server'), String(button.data('route-id')));
} catch (error) {
alert(ns.UserMessages?.error(error, ns.I18n.t("app.die.strecke.konnte.nicht.geoffnet.werden.prufe")) || ns.I18n.t("app.die.strecke.konnte.nicht.geoffnet.werden.bitte"));
alert(ns.UserMessages?.error(error, ns.I18n.t("app.error.open-route")) || ns.I18n.t("app.error.open-draft"));
} finally {
button.prop('disabled', false);
}