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

Extraction on existing project with translations in YAML files #84

Open
denrique88 opened this issue Feb 26, 2018 · 2 comments
Open

Extraction on existing project with translations in YAML files #84

denrique88 opened this issue Feb 26, 2018 · 2 comments

Comments

@denrique88
Copy link

denrique88 commented Feb 26, 2018

Hello,

In an existing project running on Symfony 2.8, I have all my translations done in YAML files (as the Symfony documentation recommend it). The YAML files are in the Resources/translations directory of each bundle of the project.

I installed the php-translation bundle and did an extract of the translations of my application with the command :
app/console translation:extract app

My problem is that all the existing translations aren't imported in the XLF files, so it seems that I should insert all the 1500 translations of my app again.

Is there a possibility for importing the existing translations ? If not, I would be interested in helping to implement this functionnality.

David

@denrique88
Copy link
Author

I answer to myself. I created two commands :

  • the first one make an export of the translation before the extraction in a json file
  • the second one make an import of the translation from a json file after the extract

I tested my commands and it works : my old YAML translations are correctly imported in the new translation catalog.

@Nyholm
Copy link
Member

Nyholm commented Mar 23, 2018

Thank you for coming back with an answer. I assume you are using the symfony bundle and not just the extractor library.
The bundle symfony core should pick up all existing translation in your yaml files and store them in memory. When the bundle's extract command has been running it will try to merge all translations.

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

2 participants