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 = [ $return = [
'status' => 'deferred', 'status' => 'deferred',
'success' => NULL, 'success' => NULL,
'title' => $translator->trans('job.runnow.deferred.title'), 'title' => $translator->trans('job.view.runnow.deferred.title'),
'message' => $translator->trans('job.runnow.deferred.message') 'message' => $translator->trans('job.view.runnow.deferred.message')
]; ];
} else { } else {
$return = [ $return = [
'status' => 'ran', 'status' => 'ran',
'success' => $runnowResult['success'], 'success' => $runnowResult['success'],
'title' => $runnowResult['success'] ? $translator->trans('job.runnow.ran.title.success') : $translator->trans('job.runnow.ran.title.failed'), 'title' => $runnowResult['success'] ? $translator->trans('job.view.runnow.ran.title.success') : $translator->trans('job.view.runnow.ran.title.failed'),
'message' => $translator->trans('job.runnow.ran.message', [ 'message' => $translator->trans('job.view.runnow.ran.message', [
'_runtime_' => number_format($runnowResult['runtime'], 3), '_runtime_' => number_format($runnowResult['runtime'], 3),
'_exitcode_' => $runnowResult['exitcode'] '_exitcode_' => $runnowResult['exitcode']
]), ]),

View File

@ -1,11 +1,11 @@
{% extends "base.html.twig" %} {% extends "base.html.twig" %}
{% block title %}{{ 'job.title' | trans({ '_jobname_': job.name }) }}{% endblock %} {% block title %}{{ 'job.title' | trans({ '_jobname_': job.name }) }}{% endblock %}
{% block content %} {% block content %}
<h2>{{ 'job.header' | trans({ '_jobname_': (job.name | parsetags) }) | raw }}</h2> <h2>{{ 'job.view.header' | trans({ '_jobname_': (job.name | parsetags) }) | raw }}</h2>
<p> <p>
<a href="{{ path('job_edit', { id: job.id }) }}">{{ 'job.edit' | 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.show.onlyfailed' | 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.show.all' | trans }}</a> {% elseif not allruns %} | <a href="{{ path('job_view', { id: job.id, all: 'all' })}}">{{ 'job.view.show.all' | trans }}</a>
{% endif %} {% endif %}
</p> </p>
<div id="runs" class="accordion"> <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 }}"> <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>
<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">{{ 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 %} {% 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 %} {% endif %}
</div> </div>
</button> </button>
@ -29,8 +29,8 @@
</div> </div>
</div> </div>
{% else %} {% else %}
<h4>{% if not allruns %}{{ "job.results.noresults.failed" | trans }}{% else %}{{ "job.results.noresults.all"| trans }}{% endif %}</h4> <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.show.all' | trans }}</a></p> <p><a href="{{ path('job_view', { id: job.id, all: 'all' })}}">{{ 'job.view.show.all' | trans }}</a></p>
{% endfor %} {% endfor %}
</div> </div>
{% endblock %} {% endblock %}

View File

@ -24,25 +24,26 @@ index:
interval: "Interval" interval: "Interval"
nextrun: "Nextrun" nextrun: "Nextrun"
job: job:
title: "Overview of runs for _jobname_" view:
header: "Overview of runs for _jobname_" title: "Overview of runs for _jobname_"
edit: "Edit job" header: "Overview of runs for _jobname_"
runnow: edit: "Edit job"
deferred: runnow:
title: "Cronjob has been scheduled" deferred:
message: "Job was scheduled to be run. You will find the output soon in the job details" title: "Cronjob has been scheduled"
ran: message: "Job was scheduled to be run. You will find the output soon in the job details"
title: ran:
success: "Cronjob succesfully ran" title:
failed: "Cronjob failed. Please check output below" success: "Cronjob succesfully ran"
message: "Cronjob ran in _runtime_ seconds with exit code _exitcode_" failed: "Cronjob failed. Please check output below"
show: message: "Cronjob ran in _runtime_ seconds with exit code _exitcode_"
onlyfailed: "Only show failed runs" show:
all: "Show all runs" onlyfailed: "Only show failed runs"
results: all: "Show all runs"
exitcode: "Exit code" results:
runtime: "Runtime" exitcode: "Exit code"
manual: "Manual run" runtime: "Runtime"
noresults: manual: "Manual run"
failed: "No failed runs found" noresults:
all: "No runs found" failed: "No failed runs found"
all: "No runs found"

View File

@ -24,25 +24,26 @@ index:
interval: "Interval" interval: "Interval"
nextrun: "Volgende uitvoering" nextrun: "Volgende uitvoering"
job: job:
title: "Overzicht van uitvoeringen van _jobname_" view:
header: "Overzicht van uitvoeringen van _jobname_" title: "Overzicht van uitvoeringen van _jobname_"
edit: "Bewerk taak" header: "Overzicht van uitvoeringen van _jobname_"
runnow: edit: "Bewerk taak"
deferred: runnow:
title: "Taak werd doorgestuurd naar de daemon" deferred:
message: "Taak werd doorgestuurd naar de daemon. De output vind u binnenkort in de taakdetails" title: "Taak werd doorgestuurd naar de daemon"
ran: message: "Taak werd doorgestuurd naar de daemon. De output vind u binnenkort in de taakdetails"
title: ran:
success: "Taak werd succesvol uitgevoerd" title:
failed: "Taak faalde. Hieronder vind u de output ter controle" success: "Taak werd succesvol uitgevoerd"
message: "Taak werd in _runtime_ seconden uitgevoerd met resultaat _exitcode_" failed: "Taak faalde. Hieronder vind u de output ter controle"
show: message: "Taak werd in _runtime_ seconden uitgevoerd met resultaat _exitcode_"
onlyfailed: "Toon alleen gefaalde uitvoeringen" show:
all: "Toon alle uitvoeringen" onlyfailed: "Toon alleen gefaalde uitvoeringen"
results: all: "Toon alle uitvoeringen"
exitcode: "Resultaat" results:
runtime: "Duurtijd" exitcode: "Resultaat"
manual: "Manuele uitvoering" runtime: "Duurtijd"
noresults: manual: "Manuele uitvoering"
failed: "Geen gefaalde uitvoeringen gevonden" noresults:
all: "Geen uitvoeringen gevonden" failed: "Geen gefaalde uitvoeringen gevonden"
all: "Geen uitvoeringen gevonden"