RickStrahl / Westwind.Globalization

Database driven resource localization for .NET applications
543 stars 135 forks source link

DbResXConverter.ImportResourceFile deletes all translations in the resource set that are not contained in the resx file. #135

Open hobwell opened 6 years ago

hobwell commented 6 years ago

In the current version, on line 737 of DbResXConverter, the entire resource set gets deleted before import.

Is there any way around this?

I may be mistaken, but I feel that in older versions of Westwind.Globalization, calls to ImportWebResources or ImportWinResources would update values appearing in the resx file within the resource set while leaving the absent resourceIds as they were and adding any items that were missing.

Currently, when making changes, I only export the changed values to a resx file to import them into production. This presently leads to a lot of missing translation. I can work around this by always outputting the entire resource set to file before updating, but it would be great if there was a way to only pick up the changes instead of re-writing unchanged values (which ends up incrementing the PK of the localizations table).

Would it be possible to add an 'UpdateResources' method, or add an optional argument to ImportResources indicating whether or not to delete the resource set?

Thanks for taking a look!

hobwell commented 6 years ago

I've created a pull request with a small change related to this issue.