Refactoring translation

This commit is contained in:
Marc Ducobu
2014-11-19 09:43:53 +01:00
parent 4c2a3c3624
commit 87b4cb65e4
18 changed files with 209 additions and 261 deletions

View File

@@ -16,28 +16,28 @@
#}
{% extends "ChillMainBundle::layout.html.twig" %}
{% block title %}{{ 'views.Person.creation.title'|trans }}{% endblock title %}
{% block title %}{{ 'Add a person'|trans }}{% endblock title %}
{% block content %}
<div id="person_wrapper">
<div id="person_details">
{{ form_start(form) }}
<h1>{{ 'views.Person.creation.open'|trans }}</h1>
<h1>{{ 'Add a person'|trans }}</h1>
{{ form_row(form.firstName, { 'label' : 'First name'|trans }) }}
{{ form_row(form.lastName, { 'label' : 'Last name'|trans }) }}
{{ form_row(form.dateOfBirth, { 'label' : 'views.Person.view.dateOfBirth'|trans }) }}
{{ form_row(form.dateOfBirth, { 'label' : 'Date of birth'|trans }) }}
{{ form_row(form.genre, { 'label' : 'views.Person.view.gender'|trans }) }}
{{ form_row(form.genre, { 'label' : 'Gender'|trans }) }}
{{ form_row(form.creation_date, { 'label' : 'views.Person.review.creation_date'|trans }) }}
{{ form_row(form.creation_date, { 'label' : 'Creation date'|trans }) }}
{{ form_rest(form) }}
<button class="sc-button green" type="submit"><i class="fa fa-plus"></i> {{ 'views.Person.creation.add'|trans }}</button>
<button class="sc-button green" type="submit"><i class="fa fa-plus"></i> {{ 'Add the person'|trans }}</button>
{{ form_end(form) }}
</div>

View File

@@ -16,7 +16,7 @@
#}
{% extends "ChillMainBundle::layout.html.twig" %}
{% block title %}{{ 'views.Person.review.title'|trans }}{% endblock title %}
{% block title %}{{ 'Alreay existing person'|trans }}{% endblock title %}
{% block css %}
@@ -35,9 +35,9 @@
<table class="rounded stripped" style="width=100%">
<thead>
<tr>
<th>{{ 'views.Person.review.altName'|trans }}</th>
<th>{{ 'views.Person.review.altDateOfBirth'|trans }}</th>
<th>{{ 'views.Person.review.altNationality'|trans }}</th>
<th>{{ 'Name'|trans }}</th>
<th>{{ 'Date of birth'|trans }}</th>
<th>{{ 'Nationality'|trans }}</th>
</tr>
</thead>
<tbody>
@@ -50,7 +50,7 @@
</a>
</td>
<td>{{ person.dateOfBirth|date(date_format) }}</td>
<td>{% if person.nationality is not null %}{{ person.nationality.name|localize_translatable_string }}{% else %}{{ 'views.Person.view.without_nationality'|trans }}{% endif %}
<td>{% if person.nationality is not null %}{{ person.nationality.name|localize_translatable_string }}{% else %}{{ 'Without nationality'|trans }}{% endif %}
</tr>
{% endfor %}
@@ -62,7 +62,7 @@
<div id="person_details">
{{ form_start(form) }}
<h2>{{ 'views.Person.review.you_will_create_this_person'|trans }}</h2>
<h2>{{ 'You will create this person'|trans }}</h2>
<dl>
<dt>{{ 'First name'|trans }}</dt>
@@ -71,19 +71,19 @@
<dt>{{ 'Last name'|trans }}</dt>
<dd>{{ lastName }}</dd>
<dt>{{ 'views.Person.view.dateOfBirth'|trans }}</dt>
<dd>{{ dateOfBirth|date(date_format)|default( 'person.without_date_of_birth'|trans ) }}</dd>
<dt>{{ 'Date of birth'|trans }}</dt>
<dd>{{ dateOfBirth|date(date_format)|default( 'Unknown date of birth'|trans ) }}</dd>
<dt>{{ 'views.Person.view.gender'|trans }}</dt>
<dd>{{ ('person.gender.' ~ genre)|trans }}</dd>
<dt>{{ 'Gender'|trans }}</dt>
<dd>{{ genre|trans }}</dd>
<dt>{{ 'views.Person.review.creation_date'|trans }}</dt>
<dt>{{ 'Creation date'|trans }}</dt>
<dd>{{ creation_date|date(date_format) }}</dd>
</dl>
{{ form_rest(form) }}
<button class="sc-button green" type="submit"><i class="fa fa-check"></i> {{ 'views.Person.review.confirm_creation'|trans }}</button>
<button class="sc-button green" type="submit"><i class="fa fa-check"></i> {{ 'Confirm the creation'|trans }}</button>
{{ form_end(form) }}
</div>

View File

@@ -27,41 +27,42 @@
{{ form_start(form) }}
<fieldset>
<legend><h2>{{ 'views.Person.view.general'|trans }}</h2></legend>
<legend><h2>{{ 'General information'|trans }}</h2></legend>
{{ form_row(form.firstName, {'label' : 'First name'}) }}
{{ form_row(form.lastName, {'label' : 'Last name'}) }}
{{ form_row(form.genre, {'label' : 'views.Person.view.gender'}) }}
{{ form_row(form.genre, {'label' : 'Gender'}) }}
</fieldset>
<fieldset>
<legend><h2>{{ 'views.Person.view.birth'|trans }}</h2></legend>
{{ form_row(form.dateOfBirth, {'label': 'views.Person.view.dateOfBirth'} ) }}
{{ form_row(form.placeOfBirth, { 'label' : 'views.Person.view.placeOfBirth'} ) }}
{{ form_row(form.countryOfBirth, { 'label' : 'views.Person.view.contry_of_birth' } ) }}
<legend><h2>{{ 'Birth information'|trans }}</h2></legend>
{{ form_row(form.dateOfBirth, {'label': 'Date of birth'} ) }}
{{ form_row(form.placeOfBirth, { 'label' : 'Place of birth'} ) }}
{{ form_row(form.countryOfBirth, { 'label' : 'Country of birth' } ) }}
</fieldset>
<fieldset>
<legend><h2>{{ 'views.Person.view.administrative'|trans }}</h2></legend>
{{ form_row(form.nationality, { 'label' : 'views.Person.view.nationality'|trans} ) }}
<legend><h2>{{ 'Administrative information'|trans }}</h2></legend>
{{ form_row(form.nationality, { 'label' : 'Nationality'|trans} ) }}
</fieldset>
<fieldset>
<legend><h2>{{ 'views.Person.view.contact'|trans }}</h2></legend>
{{ form_row(form.email, {'label': 'views.Person.view.email'}) }}
<legend><h2>{{ 'Contact information'|trans }}</h2></legend>
{{ form_row(form.email, {'label': 'Email'}) }}
{{ form_row(form.phonenumber, {'label': 'Phonenumber'}) }}
</fieldset>
{{ form_row(form.memo, {'label' : 'views.Person.view.memo'} ) }}
{{ form_row(form.memo, {'label' : 'Memo'} ) }}
{{ form_rest(form) }}
<div class="grid-12 centered sticky-form-buttons">
<a href="{{ path('chill_person_view', {'person_id' : person.id}) }}" class="sc-button grey">
<i class="fa fa-arrow-left"></i>
{{ 'views.Person.edit.cancel'|trans }}
{{ 'Return'|trans }}
</a>
<button class="sc-button green" type="submit"><i class="fa fa-save"></i> {{ 'views.Person.edit.submit'|trans }}</button>
<button class="sc-button red" type="reset"><i class="fa fa-eraser"></i> {{ 'views.Person.edit.reset'|trans }}</button>
<button class="sc-button green" type="submit"><i class="fa fa-save"></i> {{ 'Submit'|trans }}</button>
<button class="sc-button red" type="reset"><i class="fa fa-eraser"></i> {{ 'Reset'|trans }}</button>
</div>
{{ form_end(form) }}

View File

@@ -22,8 +22,8 @@
<thead>
<tr>
<th>{% trans %}Name{% endtrans %}</th>
<th>{% trans %}person.dateOfBirth{% endtrans %}</th>
<th>{% trans %}person.nationality{% endtrans %}</th>
<th>{% trans %}Date of birth{% endtrans %}</th>
<th>{% trans %}Nationality{% endtrans %}</th>
</tr>
</thead>
<tbody>
@@ -40,13 +40,13 @@
</a>
</td>
<td>
<span class="personDateOfBirth">{{person.dateOfBirth.format(date_format)|default( 'person.without_date_of_birth'|trans )}}</span>
<span class="personDateOfBirth">{{person.dateOfBirth.format(date_format)|default( 'Unknown date of birth'|trans )}}</span>
</td>
<td>
{% if person.nationality is not null %}
<span class="personNationality">{{person.nationality.label}}</span>
{% else %}
{{ 'views.Person.list.without_nationality'|trans }}
{{ 'Without nationality'|trans }}
{% endif %}
</td>
</tr>

View File

@@ -39,7 +39,7 @@ This view should receive those arguments:
{{ include(edit_tmp_name, edit_tmp_args) }}
<figure>
<h2>{{ 'views.Person.view.general'|trans }}</h2>
<h2>{{ 'General information'|trans }}</h2>
<dl>
<dt class="inline">{{ 'First name'|trans }}</dt>
@@ -48,28 +48,28 @@ This view should receive those arguments:
<dt class="inline">{{ 'Last name'|trans }}</dt>
<dd>{{ person.lastName }}</dd>
<dt class="inline">{{ 'views.Person.view.gender'|trans }}</dt>
<dd>{{ ( 'person.gender.' ~ person.genre|default('undefined'))|trans }}</dd>
<dt class="inline">{{ 'Gender'|trans }}</dt>
<dd>{{ ( person.genre|default('Not given'))|trans }}</dd>
</dl>
</figure>
<figure>
<h2>{{ 'views.Person.view.birth'|trans }}</h2>
<h2>{{ 'Birth information'|trans }}</h2>
<dl>
<dt class="inline">{{ 'views.Person.view.dateOfBirth'|trans }}</dt>
<dt class="inline">{{ 'Date of birth'|trans }}</dt>
<dd>{{ person.dateOfBirth.format(date_format)
|default( 'person.without_date_of_birth'|trans ) }}</dd>
|default( 'Unknown date of birth'|trans ) }}</dd>
<dt class="inline">{{ 'views.Person.view.placeOfBirth'|trans }}</dt>
<dt class="inline">{{ 'Place of birth'|trans }}</dt>
<dd>{{ person.placeOfBirth }}</dd>
<dd>{% spaceless %}
{% if person.countryOfBirth is not null %}
{{ person.countryOfBirth.name|localize_translatable_string }}
{% else %}
{{ 'views.Person.view.country_of_birth_unknow'|trans }}
{{ 'Unknown country of birth'|trans }}
{% endif %}
{% endspaceless %}</dd>
@@ -81,15 +81,15 @@ This view should receive those arguments:
{{ include(edit_tmp_name, edit_tmp_args) }}
<figure>
<h2>{{ 'views.Person.view.administrative'|trans }}</h2>
<h2>{{ 'Administrative information'|trans }}</h2>
<dl>
<dt class="inline">{{ 'views.Person.view.nationality'|trans }}</dt>
<dt class="inline">{{ 'Nationality'|trans }}</dt>
<dd>
{% if person.nationality is not null %}
{{ person.nationality.name|localize_translatable_string }}
{% else %}
{{ 'views.Person.view.without_nationality'|trans }}
{{ 'Without nationality'|trans }}
{% endif %}
</dd>
</dl>
@@ -98,14 +98,14 @@ This view should receive those arguments:
{{ include(edit_tmp_name, edit_tmp_args) }}
<figure>
<h2>{{ 'views.Person.view.contact'|trans }}</h2>
<h2>{{ 'Contact information'|trans }}</h2>
<dl>
<dt class="inline">{{ 'views.Person.view.email'|trans }}</dt>
<dt class="inline">{{ 'Email'|trans }}</dt>
<dd><pre>{{ person.email}}&nbsp;</pre></dd>
</dl>
<dl>
<dt class="inline">{{ 'views.Person.view.phonenumber'|trans }}</dt>
<dt class="inline">{{ 'Phonenumber'|trans }}</dt>
<dd><pre>{{ person.phonenumber}}&nbsp;</pre></dd>
</dl>