lexik / LexikTranslationBundle

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

:bug: Import with '--merge' option doesn't update existing translations #332

Closed ankhzet closed 1 year ago

ankhzet commented 5 years ago

When using import command with --merge option, updated translations aren't actually updated, but removed instead (appears when using ODM, not sure if behaves differently with ORM).

In import code the translation is removed from DB before it is cloned for (kinda) update, effectively removing original trans record reference from TransUnit record. Cloned translation record after that is persisted into DB, but there are no reference from TransUnit to newly created Translation record at that moment.

ext-mongo: 1.6.16 ext-mongodb: ^1.4 doctrine/mongodb-odm-bundle: ^3.3

Pull request with fix: https://github.com/lexik/LexikTranslationBundle/pull/329