MutationDigitale / craft3-translate

Craft CMS plugin for static translations in CP
Other
12 stars 7 forks source link

ImportService should import messages from new locales even if the same message already exist in another locale. #61

Closed obrassard closed 7 months ago

obrassard commented 7 months ago

Hello, I hope you are doing good !

We are working on a Craft website that had originally two locales (en-US and fr-CA). Today we introduced a new locale es-US, so we created a new translation file for this locale at : /translations/es-US/site.php with Spanish messages. Our goal was to import those new translations using the command craft translations-admin/utilities/import.

Unfortunately, this did not work as expected. It seems that the Spanish messages were not inserted to the database, as their Key is not new (they already exist in English and French). However, I believe it should be possible (and useful) to be able to import messages for new locales even if the translation key already exists in the database for other locales.

I understand we would not want to override texts that were previously updated by a user in the admin panel when importing messages, however if there is no value in the DB for an existing message in a specific locale (and that value is present in the php files), I don't see why we could not import it.

Thanks in advance !

smcyr commented 7 months ago

It's fixed in 3.2.2, let me know if it something is amiss. Thanks

obrassard commented 7 months ago

Thank you @smcyr