BUGFIX: Better translations

This commit is contained in:
Jeroen De Meerleer 2022-05-30 13:34:35 +02:00
parent 86e3dd3ac4
commit a0faaf9414
Signed by: JeroenED
GPG Key ID: 28CCCB8F62BFADD6
4 changed files with 58 additions and 56 deletions

View File

@ -91,15 +91,15 @@ class JobController extends AbstractController
$return = [
'status' => 'deferred',
'success' => NULL,
'title' => $translator->trans('job.runnow.deferred.title'),
'message' => $translator->trans('job.runnow.deferred.message')
'title' => $translator->trans('job.view.runnow.deferred.title'),
'message' => $translator->trans('job.view.runnow.deferred.message')
];
} else {
$return = [
'status' => 'ran',
'success' => $runnowResult['success'],
'title' => $runnowResult['success'] ? $translator->trans('job.runnow.ran.title.success') : $translator->trans('job.runnow.ran.title.failed'),
'message' => $translator->trans('job.runnow.ran.message', [
'title' => $runnowResult['success'] ? $translator->trans('job.view.runnow.ran.title.success') : $translator->trans('job.view.runnow.ran.title.failed'),
'message' => $translator->trans('job.view.runnow.ran.message', [
'_runtime_' => number_format($runnowResult['runtime'], 3),
'_exitcode_' => $runnowResult['exitcode']
]),

View File

@ -1,11 +1,11 @@
{% extends "base.html.twig" %}
{% block title %}{{ 'job.title' | trans({ '_jobname_': job.name }) }}{% endblock %}
{% block content %}
<h2>{{ 'job.header' | trans({ '_jobname_': (job.name | parsetags) }) | raw }}</h2>
<h2>{{ 'job.view.header' | trans({ '_jobname_': (job.name | parsetags) }) | raw }}</h2>
<p>
<a href="{{ path('job_edit', { id: job.id }) }}">{{ 'job.edit' | trans }}</a>
{% if allruns %} | <a href="{{ path('job_view', { id: job.id })}}">{{ 'job.show.onlyfailed' | trans }}</a>
{% elseif not allruns %} | <a href="{{ path('job_view', { id: job.id, all: 'all' })}}">{{ 'job.show.all' | trans }}</a>
<a href="{{ path('job_edit', { id: job.id }) }}">{{ 'job.view.edit' | trans }}</a>
{% if allruns %} | <a href="{{ path('job_view', { id: job.id })}}">{{ 'job.view.show.onlyfailed' | trans }}</a>
{% elseif not allruns %} | <a href="{{ path('job_view', { id: job.id, all: 'all' })}}">{{ 'job.view.show.all' | trans }}</a>
{% endif %}
</p>
<div id="runs" class="accordion">
@ -15,9 +15,9 @@
<button class="accordion-button{% if loop.index != 1 %} collapsed{% endif %}" type="button" data-bs-toggle="collapse" data-bs-target="#run-{{ run.id }}" aria-expanded="{% if loop.index != 1 %}true{% else %}false{% endif %}" aria-controls="run-{{ run.id }}">
<div>
<div class="d-md-inline d-block text-left">{{ run.timestamp | date("d/m/Y H:i:s") }}</div>
<div class="d-md-inline d-block text-left">({{ "job.results.exitcode"| trans }}: {{ run.exitcode }} | {{ "job.results.runtime"| trans }}: {{ run.runtime | interval }})</div>
<div class="d-md-inline d-block text-left">({{ "job.view.results.exitcode"| trans }}: {{ run.exitcode }} | {{ "job.view.results.runtime"| trans }}: {{ run.runtime | interval }})</div>
{% if 'M' in run.flags %}
<div class="d-md-inline d-block text-left">{{ "job.results.manual"| trans }}</div>
<div class="d-md-inline d-block text-left">{{ "job.view.results.manual"| trans }}</div>
{% endif %}
</div>
</button>
@ -29,8 +29,8 @@
</div>
</div>
{% else %}
<h4>{% if not allruns %}{{ "job.results.noresults.failed" | trans }}{% else %}{{ "job.results.noresults.all"| trans }}{% endif %}</h4>
<p><a href="{{ path('job_view', { id: job.id, all: 'all' })}}">{{ 'job.show.all' | trans }}</a></p>
<h4>{% if not allruns %}{{ "job.view.results.noresults.failed" | trans }}{% else %}{{ "job.view.results.noresults.all"| trans }}{% endif %}</h4>
<p><a href="{{ path('job_view', { id: job.id, all: 'all' })}}">{{ 'job.view.show.all' | trans }}</a></p>
{% endfor %}
</div>
{% endblock %}

View File

@ -24,6 +24,7 @@ index:
interval: "Interval"
nextrun: "Nextrun"
job:
view:
title: "Overview of runs for _jobname_"
header: "Overview of runs for _jobname_"
edit: "Edit job"

View File

@ -24,6 +24,7 @@ index:
interval: "Interval"
nextrun: "Volgende uitvoering"
job:
view:
title: "Overzicht van uitvoeringen van _jobname_"
header: "Overzicht van uitvoeringen van _jobname_"
edit: "Bewerk taak"