php-translation/documentation

File extractors to get translations

Opened this issue · 3 comments

Hello,

First of all, thank you for your work, I'm trying to get it working on a project and so far it's going well. I've found your bundle in a comment you made here.

I just wanted to understand something as I've not found it in the Symfony doc :

  • translations keys are fetched from PHP and Twig files (as said in config file), so the config entry dirs is not meant to point directly at a translation folder like src/AppBundle/Resources/translations. Is that correct ?
  • in that way, how can translations be filled from already written translations ? For example, I'm writting my translations in a YAML file in my bundle. Is there a config key to use those ?

Thank you.

Hey.
Thank you for this issue. It is probably more people that you having this confusion.

  • The dirs config entry should point to your source code. Ie /src.
  • The extracted translations keys are merged with the existing keys that is loaded by symfony. They are already in memory when we start to extract the new keys.

I'm actually asking you about current translations in AppBundle\Yaml files because I'm having an issue with them : extracting translations with the command line generate empty xliff files, ie without any translation messages (but with all the keys, that's good).

Hello,

I'm currently developping on an existing project and we'd like to use php-translation to make translations in english and german languages more easily than changing the texts in the YML files.

So, php-translation with edit-in-place and webui seems very promising !

But I'm having the same issue than AlexiZ : I extracted the translations from my code with the command app/console translation:extract and all the resulting translations in XLF files are empty...
However all the translations should be already filled in french language.

Is this an issue or a misconfiguration of my own ?