Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File extractors to get translations #28

Open
AlexiZ opened this issue Jan 14, 2018 · 3 comments
Open

File extractors to get translations #28

AlexiZ opened this issue Jan 14, 2018 · 3 comments

Comments

@AlexiZ
Copy link

AlexiZ commented Jan 14, 2018

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.

@Nyholm
Copy link
Member

Nyholm commented Jan 14, 2018

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.

@AlexiZ
Copy link
Author

AlexiZ commented Jan 15, 2018

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).

@denrique88
Copy link

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 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants