I'm using Symfony 3 and I want to make a translation of somethings in my app to Spanish.
I enabled the translator by this way:
framework:
#esi: ~
#translator: { fallbacks: ["%locale%"] }
translator: { fallbacks: en }
secret: "%secret%"
router:
resource: "%kernel.root_dir%/config/routing.yml"
strict_requirements: ~
form: ~
csrf_protection: ~
validation: { enable_annotations: true }
#serializer: { enable_annotations: true }
templating:
engines: ['twig']
#default_locale: "%locale%"
default_locale: es
trusted_hosts: ~
trusted_proxies: ~
session:
A file called by default "messages.fr.xlf" is supposed to appear in /app/resources/translation or /src/BundleName/resources/translation, but after search in all the folder structure, there is no "messages.fr.xlf" file and there is no "translation" folder, so I decided to create it by myself, and I tried it in all the folders in which this file is supposed to exist.
So my "messages" file contains the following code:
<?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>Next</source>
<target>Siguiente</target>
</trans-unit>
<trans-unit id="2">
<source>Previous</source>
<target>Anterior</target>
</trans-unit>
<trans-unit id="3">
<source>client</source>
<target>Cliente</target>
</trans-unit>
<trans-unit id="4">
<source>user</source>
<target>Usuario</target>
</trans-unit>
</body>
</file>
</xliff>
But it doesn't work, it seems that symfony can't find the translation file because I get this error:
"These messages are not available for the given locale and cannot be found in the fallback locales. Add them to the translation catalogue to avoid Symfony outputting untranslated contents."