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

@ -59,14 +59,14 @@ class HistoryController extends Controller
$flashBag->add('success', $flashBag->add('success',
$this->get('translator')->trans( $this->get('translator')->trans(
'controller.Person.history.create.done')); 'History created!'));
return $this->redirect($this->generateUrl('chill_person_history_list', return $this->redirect($this->generateUrl('chill_person_history_list',
array('person_id' => $person->getId()))); array('person_id' => $person->getId())));
} else { } else {
$flashBag->add('danger', $this->get('translator') $flashBag->add('danger', $this->get('translator')
->trans('controller.Person.history.create.error')); ->trans('Error! History not created!'));
foreach($errors as $error) { foreach($errors as $error) {
$flashBag->add('info', $error->getMessage()); $flashBag->add('info', $error->getMessage());
@ -117,14 +117,14 @@ class HistoryController extends Controller
$flashBag->add('success', $flashBag->add('success',
$this->get('translator')->trans( $this->get('translator')->trans(
'controller.Person.history.update.done')); 'Updating history done'));
return $this->redirect($this->generateUrl('chill_person_history_list', return $this->redirect($this->generateUrl('chill_person_history_list',
array('person_id' => $person->getId()))); array('person_id' => $person->getId())));
} else { } else {
$flashBag->add('danger', $this->get('translator') $flashBag->add('danger', $this->get('translator')
->trans('controller.Person.history.edit.error')); ->trans('Error when updating history'));
foreach($errors as $error) { foreach($errors as $error) {
$flashBag->add('info', $error->getMessage()); $flashBag->add('info', $error->getMessage());
@ -152,7 +152,7 @@ class HistoryController extends Controller
if ($person->isOpen() === false) { if ($person->isOpen() === false) {
$this->get('session')->getFlashBag() $this->get('session')->getFlashBag()
->add('danger', $this->get('translator') ->add('danger', $this->get('translator')
->trans('controller.Person.history.close.is_closed', ->trans('Beware history is closed',
array('%name%' => $person->__toString()))); array('%name%' => $person->__toString())));
return $this->redirect( return $this->redirect(
@ -179,7 +179,7 @@ class HistoryController extends Controller
if (count($errors) === 0) { if (count($errors) === 0) {
$this->get('session')->getFlashBag() $this->get('session')->getFlashBag()
->add('success', $this->get('translator') ->add('success', $this->get('translator')
->trans('controller.Person.history.close.done', ->trans('History closed!',
array('%name%' => $person->__toString()))); array('%name%' => $person->__toString())));
$this->getDoctrine()->getManager()->flush(); $this->getDoctrine()->getManager()->flush();
@ -192,7 +192,7 @@ class HistoryController extends Controller
} else { } else {
$this->get('session')->getFlashBag() $this->get('session')->getFlashBag()
->add('danger', $this->get('translator') ->add('danger', $this->get('translator')
->trans('controller.Person.history.close.error')); ->trans('Error! History not closed!'));
foreach ($errors as $error) { foreach ($errors as $error) {
$this->get('session')->getFlashBag() $this->get('session')->getFlashBag()
@ -207,7 +207,7 @@ class HistoryController extends Controller
} else { //if form is not valid } else { //if form is not valid
$this->get('session')->getFlashBag() $this->get('session')->getFlashBag()
->add('danger', $this->get('translator') ->add('danger', $this->get('translator')
->trans('controller.Person.history.close.error_in_form')); ->trans('History closing form is not valide'));
} }
} }
@ -255,7 +255,7 @@ class HistoryController extends Controller
if ($person->isOpen() === true) { if ($person->isOpen() === true) {
$this->get('session')->getFlashBag() $this->get('session')->getFlashBag()
->add('danger', $this->get('translator') ->add('danger', $this->get('translator')
->trans('controller.Person.history.open.is_not_closed', ->trans('Error! History %name% is not closed ; it can be open',
array('%name%' => $person->__toString()))); array('%name%' => $person->__toString())));
return $this->redirect( return $this->redirect(
@ -280,7 +280,7 @@ class HistoryController extends Controller
if (count($errors) <= 0) { if (count($errors) <= 0) {
$this->get('session')->getFlashBag() $this->get('session')->getFlashBag()
->add('success', $this->get('translator') ->add('success', $this->get('translator')
->trans('controller.Person.history.open.done', ->trans('History %name% opened!',
array('%name%' => $person->__toString()))); array('%name%' => $person->__toString())));
$this->getDoctrine()->getManager()->flush(); $this->getDoctrine()->getManager()->flush();
@ -293,7 +293,7 @@ class HistoryController extends Controller
} else { } else {
$this->get('session')->getFlashBag() $this->get('session')->getFlashBag()
->add('danger', $this->get('translator') ->add('danger', $this->get('translator')
->trans('controller.Person.history.open.error')); ->trans('History not opened'));
foreach ($errors as $error) { foreach ($errors as $error) {
$this->get('session')->getFlashBag() $this->get('session')->getFlashBag()
@ -304,7 +304,7 @@ class HistoryController extends Controller
} else { // if errors in forms } else { // if errors in forms
$this->get('session')->getFlashBag() $this->get('session')->getFlashBag()
->add('danger', $this->get('translator') ->add('danger', $this->get('translator')
->trans('controller.Person.history.open.error_in_form')); ->trans('History not opened : form is invalid'));
} }
} }

View File

@ -107,7 +107,7 @@ class PersonController extends Controller
$this->get('session')->getFlashBag() $this->get('session')->getFlashBag()
->add('success', ->add('success',
$this->get('translator') $this->get('translator')
->trans('validation.Person.form.person.success') ->trans('The person has been created')
); );
$em = $this->getDoctrine()->getManager(); $em = $this->getDoctrine()->getManager();
@ -131,7 +131,7 @@ class PersonController extends Controller
->getFlashBag() ->getFlashBag()
->add('info', ->add('info',
$this->get('translator') $this->get('translator')
->trans('search.q_is_empty') ->trans('Your query is empty. Be more explicive')
); );
} }
@ -166,7 +166,7 @@ class PersonController extends Controller
->getFlashBag() ->getFlashBag()
->add('info', ->add('info',
$this->get('translator') $this->get('translator')
->trans('search.no_results', array( ->trans('Your query %q% gives no results', array(
'%q%' => $q '%q%' => $q
)) ))
); );
@ -268,7 +268,7 @@ class PersonController extends Controller
$flashBag = $this->get('session')->getFlashBag(); $flashBag = $this->get('session')->getFlashBag();
$translator = $this->get('translator'); $translator = $this->get('translator');
$flashBag->add('danger', $translator->trans('controller.Person.review.problem_with_data')); $flashBag->add('danger', $translator->trans('The person data are not valid'));
foreach($errors as $error) { foreach($errors as $error) {
$flashBag->add('info', $error->getMessage()); $flashBag->add('info', $error->getMessage());
@ -309,7 +309,7 @@ class PersonController extends Controller
$this->get('session')->getFlashBag()->add('info', $this->get('session')->getFlashBag()->add('info',
$this->get('translator')->trans( $this->get('translator')->trans(
'controller.Person.review.people_with_similar_name', '%nb% person with similar name. Please verify that this is a new person',
array('%nb%' => count($alternatePersons))) array('%nb%' => count($alternatePersons)))
); );

View File

@ -541,13 +541,13 @@ class Person {
if ($r['result'] === self::ERROR_OPENING_NOT_CLOSED_IS_BEFORE_NEW_LINE) { if ($r['result'] === self::ERROR_OPENING_NOT_CLOSED_IS_BEFORE_NEW_LINE) {
$context->addViolationAt('history', $context->addViolationAt('history',
'validation.Person.constraint.history.open_history_without_closing', 'History not closed is before the new line',
array() ); array() );
return; return;
} }
$context->addViolationAt('history', $context->addViolationAt('history',
'validation.Person.constraint.history.opening_is_before_closing', 'Periods are collapsing',
array( array(
'%dateOpening%' => $r['dateOpening']->format('d-m-Y'), '%dateOpening%' => $r['dateOpening']->format('d-m-Y'),
'%dateClosing%' => $r['dateClosing']->format('d-m-Y'), '%dateClosing%' => $r['dateClosing']->format('d-m-Y'),

View File

@ -24,18 +24,16 @@ class GenderType extends AbstractType {
public function setDefaultOptions(OptionsResolverInterface $resolver) { public function setDefaultOptions(OptionsResolverInterface $resolver) {
$rootTranslate = 'person.gender.';
$a = array( $a = array(
Person::GENRE_MAN => $rootTranslate.Person::GENRE_MAN, Person::GENRE_MAN => Person::GENRE_MAN,
Person::GENRE_WOMAN => $rootTranslate.Person::GENRE_WOMAN Person::GENRE_WOMAN => Person::GENRE_WOMAN
); );
$resolver->setDefaults(array( $resolver->setDefaults(array(
'choices' => $a, 'choices' => $a,
'expanded' => true, 'expanded' => true,
'multiple' => false, 'multiple' => false,
'empty_value' => $rootTranslate.'undefined' 'empty_value' => 'Not given'
)); ));
} }

View File

@ -6,8 +6,8 @@ Chill\PersonBundle\Entity\Person:
- Length: - Length:
min: 2 min: 2
max: 255 max: 255
minMessage: validation.Person.constraint.name_min minMessage: 'This name is too short. It must containt {{ limit }} chars'
maxMessage: validation.Person.constraint.name_max maxMessage: 'This name is too long. It must containt {{ limit }} chars'
groups: [general, creation] groups: [general, creation]
lastName: lastName:
- NotBlank: - NotBlank:
@ -15,12 +15,12 @@ Chill\PersonBundle\Entity\Person:
- Length: - Length:
min: 2 min: 2
max: 255 max: 255
minMessage: validation.Person.constraint.name_min minMessage: 'This name is too short. It must containt {{ limit }} chars'
maxMessage: validation.Person.constraint.name_max maxMessage: 'This name is too long. It must containt {{ limit }} chars'
groups: [general] groups: [general]
dateOfBirth: dateOfBirth:
- Date: - Date:
message: validation.Person.constraint.dateOfBirth.not_valid message: 'Birthdate not valid'
groups: [general, creation] groups: [general, creation]
history: history:
- Valid: - Valid:
@ -34,14 +34,14 @@ Chill\PersonBundle\Entity\PersonHistoryFile:
properties: properties:
date_opening: date_opening:
- Date: - Date:
message: validation.history.date_opening.not_valid message: 'Opening date is not valid'
- NotNull: - NotNull:
message: validation.history.date_opening.not_null message: 'Opening date can not be null'
date_closing: date_closing:
- Date: - Date:
message: validation.history.date_closing.not_valid message: 'Closing date is not valid'
- NotNull: - NotNull:
message: validation.history.date_closing.not_null message: 'Closing date can not be null'
groups: [closed] groups: [closed]
constraints: constraints:
- Callback: - Callback:

View File

@ -1,11 +0,0 @@
<?xml version="1.0"?>
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
<file source-language="en" datatype="plaintext" original="file.ext">
<body>
<trans-unit id="1">
<source>Symfony2 is great</source>
<target>J'aime Symfony2</target>
</trans-unit>
</body>
</file>
</xliff>

View File

@ -1,137 +1,100 @@
person: #General
name: Nom 'Edit': Modifier
surname: Prénom 'First name': Prénom
dateOfBirth: Date de naissance 'Last name': Nom
without_date_of_birth: Date de naissance inconnue 'Name': Nom
nationality: Nationalité 'Date of birth': Date de naissance
without_nationality: Sans nationalité 'Unknown date of birth': Date de naissance inconnue
civil_union: 'Nationality': Nationalité
divorced: Divorcé 'Without nationality': Sans nationalité
separated: Séparé 'Gender': Genre
widow: Veuf 'Creation date': "Date d'ouverture"
unknow: Inconnu 'Not given': Non renseigné
cohab: Cohabitation légale 'Place of birth': Lieu de naissance
single: Célibataire 'Country of birth': Pays de naissance
gender: 'Unknown country of birth': Pays inconnu
MAN: Homme 'Marital status': État civil
WOM: Femme 'Number of children': "Nombre d'enfants"
undefined: Non renseigné '{0} No child|{1} One child | ]1,Inf] %nb% children': '{0} Aucun enfant|{1} Un enfant | ]1,Inf] %nb% enfants'
history: 'National number': Numéro national
close: 'Email': Courrier électronique
motives: 'Address': Adresse
not_come: Plus venu 'Memo': Mémo
finished: Accompagnement terminé 'Phonenumber': Numéro de téléphone
'{0} Born the %date | {1} Born the %date': '{0} Né le %date% | {1} Née le %date%'
search: #Gender
q_is_empty: Votre requête est vide. Veuillez introduire un terme de recherche 'Male': Homme
no_results: La requête <span class="research">%q%</span> ne renvoie aucun résultat. 'Female': Femme
'man': Homme
'woman': Femme
validation: #Marital Status
Person: 'Divorced': Divorcé(e)
form: 'Separated': Séparé(e)
person: 'Widow': Veuf(ve)
success: Bravo ! Les données ont été mises à jour. 'Unknow marital status': Indéterminé
error: '{1} Le champs %field% est incorrect. Veuillez le corriger. | ]1, Inf] Plusieurs champs sont incorrects. Veuillez les vérifier.' 'Legal cohabitant': Cohabitant légal
controller: 'Single': Célibataire
Person: 'Married': Marié(e)
review:
people_with_similar_name: %nb% personnes ont un nom similaire. Vérifiez qu'il ne s'agit pas de l'une d'elles.
problem_with_data: Les données de votre formulaire sont invalides.
history:
close:
done: Bravo ! Le dossier de <em>%name%</em> a été clotûré.
error: Les informations introduites ne sont pas valides. Le dossier n'a pu être clos.
error_in_form: Le formulaire n'est pas valide.
is_not_open: Le dossier de </em>%name%</em> n'est pas ouvert. Il ne peut donc être fermé.
open:
done: Bravo ! Le dossier de <em>%name%</em> est maintenant ouvert.
error: Les informations introduites ne sont pas valides. Le dossier n'a pu être ouvert.
error_in_form: Le formulaire n'est pas valide.
is_not_closed: Le dossier de <em>%name%</em> n'est pas fermé. Il ne peut donc être ouvert.
update:
done: Bravo ! La mise à jour de l'historique a réussi !
error: Les données introduites ne sont pas valides. Veuillez vérifier les informations ci-dessous.
create:
done: Bravo ! L'historique a été modifié.
error: Les données introduites ne sont pas valides. Veuillez vérifier les informations ci-dessous.
views: #Heading
layout: 'General information': Généralités
born: '{0} Né le %date% | {1} Née le %date%' 'Birth information': Naissance
without_nationality: Nationalité inconnue 'Family information': Famille
common: 'Contact information': Informations de contact
edit: Modifier 'Administrative information': Administratif
Person:
view:
general: Généralités
birth: Naissance
dateOfBirth: Date de naissance
placeOfBirth: Lieu de naissance
contry_of_birth: Pays de naissance
country_of_birth_unknow: Pays inconnu
without_nationality: Nationalité inconnue
family: Famille
civil_union: État civil
nb_of_childs: Nombre d'enfants
nb_of_childs_count: '{0} Aucun enfant|{1} Un enfant | ]1,Inf] %nb% enfants'
nationality: Nationalité
national_number: Numéro national
contact: Informations de contact
email: Courrier électronique
address: Adresse
administrative: Administratif
surname: Prénom
name: Nom
gender: Genre
memo: Mémo
edit:
cancel: Retour
reset: Remise à zéro
submit: Envoi
list:
without_nationality: Nationalité inconnue
#History
hlist:
title: Historique du dossier - %name%
dateOpening_title: Date d'ouverture
dateClosing_title: Date de fermeture
still_open: Toujours en cours
edit: Modifier
close: Clôre le dossier
open: Ouvrir le dossier
create: Nouvel ouverture-fermeture à une autre date
close:
last_opening_since: Dernière ouverture le %last_opening%.
action: Clotûrer
select_a_motive: Choisissez un motif
date_of_closing: Date de clotûre
motive_of_closing: Motif de clôture
texto: Mémo
open:
action: Ouvrir
date_of_opening: Date d'ouverture
texto: Mémo
hupdate:
dateOpening: Date d'ouverture
dateClosing: Date de fermeture
motive_of_closing: Motif de clôture
texto: Mémo
action: Modifier
creation:
add: Ajouter
open: Ouverture d'un dossier
review:
altName: Nom
altDateOfBirth: Prénom
altNationality: Nationalité
confirm_creation: Confirmer la création
creation_date: Date d'ouverture
you_will_create_this_person: Vous allez créer le dossier suivant
menu: #Title
person: 'Alreay existing person': Dossiers déjà encodés
history: Historique
general_view: Informations personnelles #Action
admin: 'Add the person': Ajouter la personne
index: Personnes 'Confirm the creation': Confirmer la création
helper: Pas de sous-menu actuellement. 'You will create this person': Vous allez créer le dossier suivant
'Return': Retour
'Submit': Envoi
'Reset': Remise à zéro
#Validation
'The person data has been updated': Bravo ! Les données ont été mises à jour.
'{1} The person field %field% is incorrect. Please check. | ]1, Inf] Several person fields are incorrect. Please check.': '{1} Le champs %field% est incorrect. Veuillez le corriger. | ]1, Inf] Plusieurs champs sont incorrects. Veuillez les vérifier.'
#Creation
'Add a person': "Ajout d'une personne"
#Navigation
'Person Menu': "Menu personne"
#Person Controller
'Your query is empty. Be more explicive': Votre requête est vide. Veuillez introduire un terme de recherche
'Your query %q% gives no results': La requête <span class="research">%q%</span> ne renvoie aucun résultat.
'The person data are not valid': Les données de votre formulaire sont invalides.
'%nb% person with similar name. Please verify that this is a new person': %nb% personnes ont un nom similaire. Vérifiez qu'il ne s'agit pas de l'une d'elles.
'The person has been created': Le dossier a été créé
#History
'Last opening since %last_opening%': Dernière ouverture le %last_opening%.
'Close person history': Clotûrer
'Person history - %name%': Historique du dossier - %name%
'Opening date': "Date d'ouverture"
'Closing date': "Date de fermeture"
'Still open': Toujours en cours
'Close history': Clôre le dossier
'Open history': Ouvrir le dossier
'Create history': Nouvel ouverture-fermeture à une autre date
'Closing date': Date de clotûre
'Closing motive': Motif de clôture
#History Controller
'History created!': Bravo ! Le dossier est maintenant ouvert.
'Error! History not created!': "Erreur ! Le dossier n'a pas pu être ouvert."
'Updating history done': "Bravo ! La mise à jour de l'historique a réussi !"
'Error when updating history': Les données introduites ne sont pas valides. Veuillez vérifier les informations ci-dessous.
'Beware history is closed': Attention le dossier est déjà fermé
'History closed!': Bravo ! Le dossier de <em>%name%</em> a été clotûré.
'Error! History not closed!': "Les informations introduites ne sont pas valides. Le dossier n'a pu être clos."
'History closing form is not valide': "Le formulaire n'est pas valide."
'Error! History %name% is not closed ; it can be open': "Le dossier de <em>%name%</em> n'est pas fermé. Il ne peut donc être ouvert."
'History %name% opened!': Bravo ! Le dossier de <em>%name</em> a été ouvert
'History not opened' : "Les informations introduites ne sont pas valides. Le dossier n'a pu être ouvert."

View File

@ -1,16 +1,13 @@
validation: 'This name is too short. It must containt {{ limit }} chars': Ce nom est trop court. Il devrait contenir {{ limit }} caractères.
Person: 'This name is too long. It must containt {{ limit }} chars': Ce nom est trop long. Il devrait contenir {{ limit }} caractères.
constraint: 'This number is negative. It must have at least 0 child': Ce nombre est négatif. Il ne peut y avoir moins de 0 enfants.
name_min: Ce nom est trop court. Il devrait contenir {{ limit }} caractères. 'This number is too high. It can not be superior of {{ limit }}': Ce nombre est trop élevé. Il ne peut être supérieur à {{ limit }}.
name_max: Ce nom est trop long. Il devrait contenir {{ limit }} caractères. 'This is not a number': "La valeur introduite n'est pas un nombre."
nbOfChild_min: Ce nombre est négatif. Il ne peut y avoir moins de 0 enfants. 'Birthdate not valid': "La date de naissance n'est pas valide."
nbOfChild_max: Ce nombre est trop élevé. Il ne peut être supérieur à {{ limit }}. 'Periods are collapsing': "L'historique des ouvertures et fermetures de dossier n'est pas cohérent. Des historiques d'ouverture et de fermeture se chevauchent. Vérifiez la liste des ouvertures et fermetures."
nbOfChild_invalid: La valeur introduite n'est pas un nombre. "History not closed is before the new line": "Vous tentez d'ouvrir un dossier à une date passée alors qu'il est réouvert plus tard. Veuillez insérer une nouvelle ligne d'ouverture avant de la clotûrer avant la suivante."
dateOfBirth: 'Closing date can not be before opening date': "La date de fermeture du dossier ne peut pas être avant la date d'ouverture."
not_valid: La date de naissance n'est pas valide. 'Opening date is not valid': "La date d'ouverture n'est pas valide"
history: 'Opening date can not be null': "La date d'ouverure ne peut être nulle"
opening_is_before_closing: L'historique des ouvertures et fermetures de dossier n'est pas cohérent. Des historiques d'ouverture et de fermeture se chevauchent. Vérifiez la liste des ouvertures et fermetures. 'Closing date is not valid': "La date de fermeture n'est pas valide"
open_history_without_closing: Vous tentez d'ouvrir un dossier à une date passée alors qu'il est réouvert plus tard. Veuillez insérer une nouvelle ligne d'ouverture avant de la clotûrer avant la suivante. 'Closing date can not be null': "La date de fermeture ne peut être nulle"
PersonHistoryFile:
constraint:
dateOfClosing_before_dateOfOpening: La date de fermeture du dossier ne peut pas être avant la date d'ouverture.

View File

@ -1,6 +1,6 @@
<div class="form_control"> <div class="form_control">
<div class="controls"> <div class="controls">
<div class="small warning btn icon-right entypo icon-pencil"><a href="{{ path(form_path_key, form_path_args) }}">{{ 'views.common.edit'|trans }}</a></div> <div class="small warning btn icon-right entypo icon-pencil"><a href="{{ path(form_path_key, form_path_args) }}">{{ 'Edit'|trans }}</a></div>
</div> </div>
</div> </div>

View File

@ -9,23 +9,23 @@
{{ form_start(form) }} {{ form_start(form) }}
{{ 'views.Person.close.last_opening_since'|trans( {{ 'Last opening since %last_opening%'|trans(
{ '%last_opening%' : history.dateOpening|date(date_format) }) }} { '%last_opening%' : history.dateOpening|date(date_format) }) }}
{% if form.dateClosing is defined %} {% if form.dateClosing is defined %}
{{ form_row(form.dateClosing, {'label' : 'views.Person.close.date_of_closing'} ) }} {{ form_row(form.dateClosing, {'label' : 'Closing date'} ) }}
{% endif %} {% endif %}
{% if form.closingMotive is defined %} {% if form.closingMotive is defined %}
{{ form_row(form.closingMotive, {'label' : 'views.Person.close.motive_of_closing'} ) }} {{ form_row(form.closingMotive, {'label' : 'Closing motive'} ) }}
{% endif %} {% endif %}
{{ form_row(form.memo, {'label' : 'views.Person.close.texto' } ) }} {{ form_row(form.memo, {'label' : 'Memo' } ) }}
{{ form_rest(form) }} {{ form_rest(form) }}
<div class="medium btn danger icon-right entypo icon-lock"> <div class="medium btn danger icon-right entypo icon-lock">
<button type="submit">{{ 'views.Person.close.action'|trans }}</button> <button type="submit">{{ 'Close person history'|trans }}</button>
</div> </div>
{{ form_end(form) }} {{ form_end(form) }}

View File

@ -2,14 +2,14 @@
{% set activeRouteKey = 'chill_person_history_list' %} {% set activeRouteKey = 'chill_person_history_list' %}
{% block title %}{{ 'views.Person.hlist.title'|trans({ '%name%' : person.__toString}) }}{% endblock title %} {% block title %}{{ 'Person history - %name%'|trans({ '%name%' : person.__toString}) }}{% endblock title %}
{% block personcontent %} {% block personcontent %}
<table class="rounded"> <table class="rounded">
<thead> <thead>
<tr> <tr>
<th>{{ 'views.Person.hlist.dateOpening_title'|trans }}</th> <th>{{ 'Opening date'|trans }}</th>
<th>{{ 'views.Person.hlist.dateClosing_title'|trans }}</th> <th>{{ 'Closing date'|trans }}</th>
<th>&nbsp;</th> <th>&nbsp;</th>
</tr> </tr>
@ -21,7 +21,7 @@
<td>{{ history.dateOpening|date(date_format) }}</td> <td>{{ history.dateOpening|date(date_format) }}</td>
<td>{% spaceless %} <td>{% spaceless %}
{% if history.isOpen %} {% if history.isOpen %}
{{ 'views.Person.hlist.still_open'|trans }} {{ 'Still open'|trans }}
{% else %} {% else %}
{{ history.dateClosing|date(date_format) }} {{ history.dateClosing|date(date_format) }}
@ -30,7 +30,7 @@
{% endspaceless %}</td> {% endspaceless %}</td>
<td> <td>
<div class="small warning btn icon-right entypo icon-pencil"> <div class="small warning btn icon-right entypo icon-pencil">
<a href="{{ path('chill_person_history_update', {'person_id' : person.id, 'history_id' : history.id } ) }}">{{ 'views.Person.hlist.edit'|trans }}</a> <a href="{{ path('chill_person_history_update', {'person_id' : person.id, 'history_id' : history.id } ) }}">{{ 'Edit'|trans }}</a>
</div> </div>
</td> </td>
</tr> </tr>
@ -50,7 +50,7 @@
<div class="form_control"> <div class="form_control">
<div class="btn small warning icon-right entypo icon-plus"> <div class="btn small warning icon-right entypo icon-plus">
<a href="{{ path ('chill_person_history_create', {'person_id' : person.id } ) }}"> <a href="{{ path ('chill_person_history_create', {'person_id' : person.id } ) }}">
{{ 'views.Person.hlist.create'|trans }} {{ 'Create history'|trans }}
</a> </a>
</div> </div>
@ -64,11 +64,11 @@
{% spaceless %} {% spaceless %}
{% if person.isOpen == true %} {% if person.isOpen == true %}
<a href="{{ path('chill_person_history_close', {'person_id' : person.id}) }}"> <a href="{{ path('chill_person_history_close', {'person_id' : person.id}) }}">
{{'views.Person.hlist.close'|trans }} {{'Close history'|trans }}
</a> </a>
{% else %} {% else %}
<a href="{{ path('chill_person_history_open', {'person_id' : person.id} ) }}"> <a href="{{ path('chill_person_history_open', {'person_id' : person.id} ) }}">
{{'views.Person.hlist.open'|trans }} {{'Open history'|trans }}
</a> </a>
{% endif %} {% endif %}
{% endspaceless %} {% endspaceless %}

View File

@ -16,28 +16,28 @@
#} #}
{% extends "ChillMainBundle::layout.html.twig" %} {% extends "ChillMainBundle::layout.html.twig" %}
{% block title %}{{ 'views.Person.creation.title'|trans }}{% endblock title %} {% block title %}{{ 'Add a person'|trans }}{% endblock title %}
{% block content %} {% block content %}
<div id="person_wrapper"> <div id="person_wrapper">
<div id="person_details"> <div id="person_details">
{{ form_start(form) }} {{ 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.firstName, { 'label' : 'First name'|trans }) }}
{{ form_row(form.lastName, { 'label' : 'Last 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) }} {{ 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) }} {{ form_end(form) }}
</div> </div>

View File

@ -16,7 +16,7 @@
#} #}
{% extends "ChillMainBundle::layout.html.twig" %} {% extends "ChillMainBundle::layout.html.twig" %}
{% block title %}{{ 'views.Person.review.title'|trans }}{% endblock title %} {% block title %}{{ 'Alreay existing person'|trans }}{% endblock title %}
{% block css %} {% block css %}
@ -35,9 +35,9 @@
<table class="rounded stripped" style="width=100%"> <table class="rounded stripped" style="width=100%">
<thead> <thead>
<tr> <tr>
<th>{{ 'views.Person.review.altName'|trans }}</th> <th>{{ 'Name'|trans }}</th>
<th>{{ 'views.Person.review.altDateOfBirth'|trans }}</th> <th>{{ 'Date of birth'|trans }}</th>
<th>{{ 'views.Person.review.altNationality'|trans }}</th> <th>{{ 'Nationality'|trans }}</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@ -50,7 +50,7 @@
</a> </a>
</td> </td>
<td>{{ person.dateOfBirth|date(date_format) }}</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> </tr>
{% endfor %} {% endfor %}
@ -62,7 +62,7 @@
<div id="person_details"> <div id="person_details">
{{ form_start(form) }} {{ form_start(form) }}
<h2>{{ 'views.Person.review.you_will_create_this_person'|trans }}</h2> <h2>{{ 'You will create this person'|trans }}</h2>
<dl> <dl>
<dt>{{ 'First name'|trans }}</dt> <dt>{{ 'First name'|trans }}</dt>
@ -71,19 +71,19 @@
<dt>{{ 'Last name'|trans }}</dt> <dt>{{ 'Last name'|trans }}</dt>
<dd>{{ lastName }}</dd> <dd>{{ lastName }}</dd>
<dt>{{ 'views.Person.view.dateOfBirth'|trans }}</dt> <dt>{{ 'Date of birth'|trans }}</dt>
<dd>{{ dateOfBirth|date(date_format)|default( 'person.without_date_of_birth'|trans ) }}</dd> <dd>{{ dateOfBirth|date(date_format)|default( 'Unknown date of birth'|trans ) }}</dd>
<dt>{{ 'views.Person.view.gender'|trans }}</dt> <dt>{{ 'Gender'|trans }}</dt>
<dd>{{ ('person.gender.' ~ genre)|trans }}</dd> <dd>{{ genre|trans }}</dd>
<dt>{{ 'views.Person.review.creation_date'|trans }}</dt> <dt>{{ 'Creation date'|trans }}</dt>
<dd>{{ creation_date|date(date_format) }}</dd> <dd>{{ creation_date|date(date_format) }}</dd>
</dl> </dl>
{{ form_rest(form) }} {{ 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) }} {{ form_end(form) }}
</div> </div>

View File

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

View File

@ -22,8 +22,8 @@
<thead> <thead>
<tr> <tr>
<th>{% trans %}Name{% endtrans %}</th> <th>{% trans %}Name{% endtrans %}</th>
<th>{% trans %}person.dateOfBirth{% endtrans %}</th> <th>{% trans %}Date of birth{% endtrans %}</th>
<th>{% trans %}person.nationality{% endtrans %}</th> <th>{% trans %}Nationality{% endtrans %}</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@ -40,13 +40,13 @@
</a> </a>
</td> </td>
<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>
<td> <td>
{% if person.nationality is not null %} {% if person.nationality is not null %}
<span class="personNationality">{{person.nationality.label}}</span> <span class="personNationality">{{person.nationality.label}}</span>
{% else %} {% else %}
{{ 'views.Person.list.without_nationality'|trans }} {{ 'Without nationality'|trans }}
{% endif %} {% endif %}
</td> </td>
</tr> </tr>

View File

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

View File

@ -46,12 +46,12 @@
<div class="grid-4"> <div class="grid-4">
<p><i class="fa fa-birthday-cake"></i> {% spaceless %} <p><i class="fa fa-birthday-cake"></i> {% spaceless %}
{% if person.dateOfBirth == null %} {% if person.dateOfBirth == null %}
{{ 'person.without_date_of_birth'|trans }}, {{ ('person.gender.' ~ {{ 'Unknown date of birth'|trans }}, {{ ('person.gender.' ~
person.genre)|trans }} person.genre)|trans }}
{% else %} {% else %}
{% transchoice person.genreNumeric {% transchoice person.genreNumeric
with {'%date%' : person.dateOfBirth.format('d-m-Y')} %} with {'%date%' : person.dateOfBirth.format('d-m-Y')} %}
views.layout.born {0} Born the %date | {1} Born the %date
{% endtranschoice %} {% endtranschoice %}
{% endif %} {% endif %}
{% endspaceless %}</p> {% endspaceless %}</p>
@ -59,7 +59,7 @@
{% if person.nationality is not null %} {% if person.nationality is not null %}
<p><i class="fa fa-flag"></i> {{ person.nationality.name|localize_translatable_string }}</p> <p><i class="fa fa-flag"></i> {{ person.nationality.name|localize_translatable_string }}</p>
{% else %} {% else %}
<p class="without_nationality"><i class="fa fa-flag"></i> {% trans %}views.layout.without_nationality{% endtrans %}</p> <p class="without_nationality"><i class="fa fa-flag"></i> {% trans %}Without nationality{% endtrans %}</p>
{% endif %} {% endif %}
</div> </div>
</div> </div>

View File

@ -16,7 +16,7 @@
#} #}
<div class="grid-4"> <div class="grid-4">
<ul class="tab-nav follow-href-path"> <ul class="tab-nav follow-href-path">
<li class="title">{{ 'Menu Person'|trans }}</li> <li class="title">{{ 'Person Menu'|trans }}</li>
{% for route in routes %} {% for route in routes %}
<li class="{% spaceless %} <li class="{% spaceless %}
{% if route.key == activeRouteKey %} {% if route.key == activeRouteKey %}