Skip to content

Commit

Permalink
Début i18n crf-devs#223
Browse files Browse the repository at this point in the history
  • Loading branch information
Ingrid Azema committed Apr 7, 2020
1 parent d7d96f5 commit 3996168
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 22 deletions.
4 changes: 2 additions & 2 deletions templates/_footer.html.twig
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<footer class="page-footer font-small">
<div class="footer-copyright text-center">
<p class="font-italic text-secondary">
Réserve Opérationnelle - Croix-Rouge Française à Paris<br />
Contribuez au projet: <a href="https://github.com/crf-devs/resop/" target="_blank" class="text-body">github.com/crf-devs/resop</a><br />
{{ 'ProjectName' | trans }}<br />
{{ 'Contribute' | trans }} <a href="https://github.com/crf-devs/resop/" target="_blank" class="text-body">github.com/crf-devs/resop</a><br />
{{ build_tag }}
</p>
</div>
Expand Down
10 changes: 5 additions & 5 deletions templates/base.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" href="/favicon.ico" />
<title>ResOP - {% block title %}Welcome!{% endblock %}</title>
<title>ResOP - {% block title %}{{ 'Welcome' | trans }}!{% endblock %}</title>
{% block stylesheets %}
{{ encore_entry_link_tags('app') }}
{% endblock %}
Expand All @@ -19,16 +19,16 @@
<div class="collapse navbar-collapse" id="navbarContent">
<ul class="navbar-nav mr-auto">
<li class="nav-item active">
<a class="nav-link" href="{{ path('user_home')}}">Accueil</a>
<a class="nav-link" href="{{ path('user_home')}}">{{ 'Home' | trans }}</a>
</li>
</ul>
<div class="my-2 my-lg-0 d-flex">
{% if not app.user %}
<a class="nav-link" href="{{ path('app_login')}}">Espace bénévole</a>
<a class="nav-link" href="{{ path('app_organization_login')}}">Espace structure</a>
<a class="nav-link" href="{{ path('app_login')}}">{{ 'Section.Volunteer' | trans }}</a>
<a class="nav-link" href="{{ path('app_organization_login')}}">{{ 'Section.Organization' | trans }}</a>
{% else %}
{{ app.user }}
<a class="mx-4" href="{{ logout_path() }}">Déconnexion</a>
<a class="mx-4" href="{{ logout_path() }}">{{ 'Logout' | trans }}</a>
{% endif %}
</div>
</div>
Expand Down
16 changes: 8 additions & 8 deletions templates/user/index.html.twig
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{% extends 'base.html.twig' %}

{% block title %}Espace utilisateur{% endblock %}
{% block title %}{{ 'Section.Volunteer' | trans }}{% endblock %}

{% block body %}
{{ include('misc/flash-messages.html.twig') }}
<h1>Bienvenue, {{ app.user.fullName }}</h1>
<p>NIVOL : {{ app.user.identificationNumber }}</p>
<p><a class="btn btn-primary" href="{{ path('user_edit') }}" role="button">Modifier mes informations</a></p>
<h1>{{ 'Welcome' | trans }}, {{ app.user.fullName }}</h1>
<p>{{ 'UserIdentificationNumber' | trans }} : {{ app.user.identificationNumber }}</p>
<p><a class="btn btn-primary" href="{{ path('user_edit') }}" role="button">{{ 'EditMyInfo' | trans }}</a></p>

<p>Semaine actuelle : du {{ 'this week' | date('d/m/Y') }} au {{ 'sunday this week' | date('d/m/Y') }}</p>
<p><a class="btn btn-outline-primary" href="{{ path('user_availability') }}" role="button">Mes disponibilités pour la semaine courante</a></p>
<p>{{ 'Week.Current' | trans }} : {{ 'From' | trans }} {{ 'this week' | date('d/m/Y') }} {{ 'To' | trans }} {{ 'sunday this week' | date('d/m/Y') }}</p>
<p><a class="btn btn-outline-primary" href="{{ path('user_availability') }}" role="button">{{ 'UserAvailabilityCurrentWeek' | trans }}</a></p>

<p>Semaine prochaine : du {{ 'next week' | date('d/m/Y') }} au {{ 'sunday next week' | date('d/m/Y') }}</p>
<p><a class="btn btn-outline-primary" href="{{ path('user_availability', { week: 'next week'|date('o-\\WW') }) }}" role="button">Mes disponibilités pour la semaine prochaine</a></p>
<p>{{ 'Week.Next' | trans }} : {{ 'From' | trans }} {{ 'next week' | date('d/m/Y') }} {{ 'To' | trans }} {{ 'sunday next week' | date('d/m/Y') }}</p>
<p><a class="btn btn-outline-primary" href="{{ path('user_availability', { week: 'next week'|date('o-\\WW') }) }}" role="button">{{ 'UserAvailabilityNextWeek' | trans }}</a></p>
{% endblock %}
14 changes: 7 additions & 7 deletions templates/user/login.html.twig
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% extends 'base.html.twig' %}

{% block title %}Connexion{% endblock %}
{% block title %}{{ 'Login' | trans }}{% endblock %}

{% block body %}
<form method="post">
Expand All @@ -10,24 +10,24 @@
<div class="alert alert-danger">{{ error.messageKey|trans(error.messageData, 'security') }}</div>
{% endif %}

<h1 class="h3 mb-3 font-weight-normal">Connexion</h1>
<h1 class="h3 mb-3 font-weight-normal">{{ 'Login' | trans }}</h1>

{{ form_start(loginForm) }}
{{ form_row(loginForm.identifier, {label: 'Numéro NIVOL ou Adresse e-mail'}) }}
{{ form_row(loginForm.birthday, {label: 'Date de naissance'}) }}
{{ form_row(loginForm.identifier, {label: 'UserLogin' | trans }) }}
{{ form_row(loginForm.birthday, {label: 'DoB' | trans }) }}

<div class="mt-4 mb-2 d-flex">
<label>
<input type="checkbox" name="_remember_me"> Se souvenir de moi
<input type="checkbox" name="_remember_me"> {{ 'RememberMe' | trans }}
</label>
</div>

<button class="btn btn-lg btn-primary w-100" type="submit">Je me connecte</button>
<button class="btn btn-lg btn-primary w-100" type="submit">{{ 'LoginSubmit' | trans }}</button>

{{ form_end(loginForm) }}

<p class="mt-1">
<a class="btn btn-lg btn-info w-100" href="{{ path('user_new') }}">Créer mon compte</a>
<a class="btn btn-lg btn-info w-100" href="{{ path('user_new') }}">{{ 'CreateMyAccount' | trans }}</a>
</p>
</div>
</div>
Expand Down
23 changes: 23 additions & 0 deletions translations/messages.fr.yaml
Original file line number Diff line number Diff line change
@@ -1 +1,24 @@
Contribute: "Contribuez au projet\xA0:"
CreateMyAccount: Créer mon compte
DoB: Date de naissance
EditMyInfo: Modifier mes informations
From: du
Home: Accueil
Login: Connexion
LoginSubmit: Je me connecte
Logout: Déconnexion
ProjectName: Réserve opérationnelle - Croix-Rouge Française à Paris
RememberMe: Se souvenir de moi
Section:
Volunteer: Espace bénévole
Organization: Espace structure
Submit: Enregistrer
To: au
UserAvailabilityCurrentWeek: Mes disponibilités pour la semaine courante
UserAvailabilityNextWeek: Mes disponibilités pour la semaine prochaine
UserLogin: Numéro NIVOL ou Adresse e-mail
UserIdentificationNumber: NIVOL
Week:
Current: Semaine actuelle
Next: Semaine prochaine
Welcome: Bienvenue

0 comments on commit 3996168

Please sign in to comment.