wearerequired / traduttore

🗼 A WordPress plugin to improve the I18N workflow for your own projects based on @GlotPress.
https://wearerequired.github.io/traduttore/
72 stars 15 forks source link

Schedule a new language pack generation after originals imported #127

Closed ocean90 closed 5 years ago

ocean90 commented 5 years ago

Issue Overview Language packs are currently only generated on gp_translation_saved which is called on $translation->save() which doesn't cover an original that has been marked as obsolete.

To Reproduce Steps to reproduce the behavior:

  1. Remove a string from the source
  2. Create a new POT file
  3. Import POT file
  4. See the "1 string obsoleted" message

Expected behavior A new language pack is triggered.

Additional context gp_originals_imported: https://github.com/GlotPress/GlotPress-WP/blob/2.3.1/gp-includes/things/original.php#L337-L349

swissspidy commented 5 years ago

So we'd schedule an update whenever $originals_obsoleted, $originals_fuzzied or $originals_error is greater than 0? Or just $originals_obsoleted?