Ver Mensaje Individual
  #1 (permalink)  
Antiguo 06/09/2014, 07:33
yamidvo
 
Fecha de Ingreso: junio-2012
Ubicación: colombia
Mensajes: 48
Antigüedad: 11 años, 10 meses
Puntos: 0
Pregunta Traduccion mensaje de validacion

Estoy traduciendo los mensajes de validacion pero tengo un problema, cuando la aplicacion esta en ingles me muestra los mensajes en dicho idio pero cuando cambo la aplicacion a español no aparece el mensaje.
Asi tengo configurados los archivos:
Código XML:
Ver original
  1. //validators.es.xlf
  2. <?xml version="1.0" encoding="utf-8" ?>
  3. <xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
  4.     <file source-language="es" datatype="plaintext" original="file.ext">
  5.         <body>
  6.             <trans-unit id="1">
  7.                 <source>soporte.nombre.not_blank</source>
  8.                 <target>El nombre del soporte no puede ser vacio.</target>
  9.             </trans-unit>
  10.             <trans-unit id="2">
  11.                 <source>soporte.codigo.is_integer</source>
  12.                 <target>El codigo debe ser entero</target>
  13.             </trans-unit>
  14.         </body>
  15.     </file>
  16. </xliff>
Código XML:
Ver original
  1. //validators.en.xlf
  2. <?xml version="1.0" encoding="utf-8" ?>
  3. <xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
  4.     <file source-language="en" datatype="plaintext" original="file.ext">
  5.         <body>
  6.             <trans-unit id="1">
  7.                 <source>soporte.nombre.not_blank</source>
  8.                 <target>The name cannot be empty</target>
  9.             </trans-unit>
  10.             <trans-unit id="2">
  11.                 <source>soporte.price.is_integer</source>
  12.                 <target>The price should be integer</target>
  13.             </trans-unit>
  14.         </body>
  15.     </file>
  16. </xliff>
Código PHP:
Ver original
  1. //validation.yml
  2. Configuracion\ConfiguracionBundle\Entity\Tsoporte:
  3.     properties:
  4.         nombre:
  5.             - NotBlank:  { message: "soporte.nombre.not_blank" }
  6.         precio:
  7.             - NotNull: ~
  8.             - Type:
  9.                 type: integer
  10.                 message: "soporte.price.is_integer"
Como dije anteriormente, cuando la aplicacion esta en ingles muestra el mensaje respectivo en ingles, pero si la cambio en español muestra aparece el mensaje que esta entre comillas en el archivo validation.yml