Ajout de la traduction (#15)

Co-authored-by: hugo.pradier2 <hugo.pradier2@etu.uca.fr>
Co-authored-by: clfreville2 <clement.freville2@etu.uca.fr>
Reviewed-on: https://codefirst.iut.uca.fr/git/clement.freville2/herbarium/pulls/15
Reviewed-by: Clément FRÉVILLE <clement.freville2@etu.uca.fr>
Co-authored-by: Hugo PRADIER <hugo.pradier2@etu.uca.fr>
Co-committed-by: Hugo PRADIER <hugo.pradier2@etu.uca.fr>
This commit is contained in:
Hugo PRADIER
2024-06-13 08:46:30 +02:00
committed by Clément FRÉVILLE
parent ccb2b541ea
commit 8a1edeb938
31 changed files with 1919 additions and 94 deletions

View File

@@ -1,4 +1,4 @@
<form method="post" action="{{ path('app_post_delete', {'id': post.id}) }}" onsubmit="return confirm('Are you sure you want to delete this item?');">
<form method="post" action="{{ path('app_post_delete', {'id': post.id}) }}" onsubmit="return confirm('{{ 'delete_confirm'|trans }}');">
<input type="hidden" name="_token" value="{{ csrf_token('delete' ~ post.id) }}">
<button class="btn btn-danger">Delete</button>
<button class="btn btn-danger">{{ 'delete'|trans }}</button>
</form>

View File

@@ -1,4 +1,4 @@
{{ form_start(form) }}
{{ form_widget(form) }}
<button class="btn btn-primary">{{ button_label|default('Save') }}</button>
<button class="btn">{{ button_label|default('save'|trans) }}</button>
{{ form_end(form) }}

View File

@@ -3,11 +3,10 @@
{% block title %}Edit Post{% endblock %}
{% block body %}
<h1>Edit Post</h1>
<h1>{{ 'edit_post'|trans }}</h1>
{{ include('post/_form.html.twig', {'button_label': 'Update'}) }}
<a href="{{ path('app_post_index') }}">back to list</a>
{{ include('post/_form.html.twig', {'button_label': 'update'|trans}) }}
<a href="{{ path('app_post_index') }}">{{ 'back_to_list'|trans }}</a>
{{ include('post/_delete_form.html.twig') }}
{% endblock %}

View File

@@ -1,19 +1,19 @@
{% extends 'base.html.twig' %}
{% block title %}Posts{% endblock %}
{% block title %}{{ 'posts'|trans }}{% endblock %}
{% block body %}
{% for post in posts.iterator %}
<div class="card mb-4">
<div class="card" style="width: 42rem; margin: 20px 0 50px 100px;">
<div class="card-body">
<h5 class="card-title"><a href="{{ path('app_post_show', {id: post.id}) }}">{{ post.species ? post.species.vernacularName : 'Post' }}</a></h5>
<h5 class="card-title">{{ post.species ? post.species.vernacularName : 'post_undefined'|trans }}</h5>
<h6 class="card-subtitle mb-2 text-muted">{{ post.foundDate | date("d/m/Y \\à H \\h") }}</h6>
<p class="card-subtitle mb-2 text-muted">{{ post.latitude }}, {{ post.longitude }}, {{ post.altitude }}m</p>
<p class="card-text">{{ post.commentary }}</p>
</div>
<div class="card-footer">
28 ❤️
{{ post.comments.count() }} 💬
128 💬
</div>
</div>
{% endfor %}

View File

@@ -1,11 +1,11 @@
{% extends 'base.html.twig' %}
{% block title %}New Post{% endblock %}
{% block title %}{{ 'new_post'|trans }}{% endblock %}
{% block body %}
<h1>Create new Post</h1>
<h1>{{ 'create_new_post'|trans }}</h1>
{{ include('post/_form.html.twig') }}
<a href="{{ path('app_post_index') }}">back to list</a>
<a href="{{ path('app_post_index') }}">{{ 'back_to_list'|trans }}</a>
{% endblock %}

View File

@@ -1,9 +1,9 @@
{% extends 'base.html.twig' %}
{% block title %}Post{% endblock %}
{% block title %}{{ 'post'|trans }}{% endblock %}
{% block body %}
<h1>Post</h1>
<h1>{{ 'post'|trans }}</h1>
<table class="table">
<tbody>
@@ -12,11 +12,11 @@
<td>{{ post.id }}</td>
</tr>
<tr>
<th>FoundDate</th>
<th>{{ 'found_date'|trans }}</th>
<td>{{ post.foundDate ? post.foundDate|date('Y-m-d H:i:s') : '' }}</td>
</tr>
<tr>
<th>PublicationDate</th>
<th>{{ 'publication_date'|trans }}</th>
<td>{{ post.publicationDate ? post.publicationDate|date('Y-m-d H:i:s') : '' }}</td>
</tr>
<tr>
@@ -38,15 +38,15 @@
</tr>
{% endif %}
<tr>
<th>Commentary</th>
<th>{{ 'commentary'|trans }}</th>
<td>{{ post.commentary }}</td>
</tr>
</tbody>
</table>
<a href="{{ path('app_post_index') }}">back to list</a>
<a href="{{ path('app_post_index') }}">{{ 'back_to_list'|trans }}</a>
<a href="{{ path('app_post_edit', {'id': post.id}) }}">edit</a>
<a href="{{ path('app_post_edit', {'id': post.id}) }}">{{ 'edit'|trans }}</a>
{{ include('post/_delete_form.html.twig') }}

View File

@@ -1,21 +1,21 @@
{% extends 'base.html.twig' %}
{% block title %}Post index{% endblock %}
{% block title %}{{ 'post_index'|trans }}{% endblock %}
{% block body %}
<h1>Post index</h1>
<h1>{{ 'post_index'|trans }}</h1>
<table class="table">
<thead>
<tr>
<th>Id</th>
<th>FoundDate</th>
<th>PublicationDate</th>
<th>{{ 'found_date'|trans }}</th>
<th>{{ 'publication_date'|trans }}</th>
<th>Latitude</th>
<th>Longitude</th>
<th>Altitude</th>
<th>Commentary</th>
<th>actions</th>
<th>{{ 'commentary'|trans }}</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
@@ -29,17 +29,17 @@
<td>{{ post.altitude }}</td>
<td>{{ post.commentary }}</td>
<td>
<a href="{{ path('app_post_show', {'id': post.id}) }}">show</a>
<a href="{{ path('app_post_edit', {'id': post.id}) }}">edit</a>
<a href="{{ path('app_post_show', {'id': post.id}) }}">{{ 'show'|trans }}</a>
<a href="{{ path('app_post_edit', {'id': post.id}) }}">{{ 'edit'|trans }}</a>
</td>
</tr>
{% else %}
<tr>
<td colspan="8">no records found</td>
<td colspan="8">{{ 'no_records_found'|trans }}</td>
</tr>
{% endfor %}
</tbody>
</table>
<a href="{{ path('app_post_new') }}">Create new</a>
<a href="{{ path('app_post_new') }}">{{ 'create_new'|trans }}</a>
{% endblock %}