lexik / LexikTranslationBundle

This Symfony bundle allow to import translation files content into the database and provide a GUI to edit translations.
MIT License
419 stars 255 forks source link

Allow to use --merge option with --import-path option #429

Open WarGeneration opened 1 year ago

WarGeneration commented 1 year ago

Hello, I have several bundles lets name them as A, B, C. These bundles have its own translation files A.en.xlf, B.en.xlf, C.en.xlf.

I use lexik:translations:import --import-path=translations -i to import translations from project. But if i create <project_dir>/translations/A.en.xlf to override some translation from bundle, it wont happen.

Lexik\Bundle\TranslationBundle\Translation\Importer\FileImporter will use manager's method addTranslation which does not update exists translation, it only adds new if there isn't translation for given locale.

I tried to remove --merge option from command's check() method, and executed lexik:translations:import --import-path=translations -i -m. After that all my project translations overrode translations from bundles.

So main question why do you disallow using --merge option with --import-path option?

bartmcleod commented 1 year ago

I don't know if there is any valid reason do disallow merging with specific imported files.

WarGeneration commented 1 year ago

so should i create PR for that?

bartmcleod commented 1 year ago

@WarGeneration That would be great