inpsyde / wp-translation-downloader

Composer plugin to download WordPress translations
MIT License
46 stars 3 forks source link

[Enhancement] Download translations on first install #1

Closed kraftner closed 4 years ago

kraftner commented 5 years ago

Currently translations are only downloaded when a package is installed or updated. But if you didn't add wp-translation-downloader from the very beginning, translations do not get downloaded at all until a package gets updated.

I see three approaches:

  1. Won't fix: One should install this package in the beginning. 😭
  2. Add a possibility to manually trigger download of all translations, e.g. with an additional composer command. 🙂
  3. Download all packages automatically when wp-translation-downloader is first installed. 😍

Concerning 3 I have admittedly never really looked into the internals of Composer, hence I am not sure if the post-package-install event already gets triggered on this Plugins own installation. But if yes I'd assume this would be the perfect way to then loop through all required packages and download translations.

tyrann0us commented 5 years ago

As a workaround, you could delete wp-content/plugins//wp-content/themes/ and run composer install. wp-translation-downloader should then download language files for all packages.

kraftner commented 5 years ago

:smile: Thanks, I figured that out myself, but good to mention it here too. :+1:

MaximeCulea commented 4 years ago

Hi there 👋

Option 3 seems like overkill since we have to manually configure the extras :P For me, the second option seems legit, to have the possibility to manually lunch it. It could also be a solution in some cases to check if any new translations or whatever. Because GlotPress new translations are not related to plugins update.

Just my feedback on this, good job anyway! ;)

Chrico commented 4 years ago

Howdy. Sorry for beeing very very very late 😬

With the latest changes in dev-master i implemented the possibility to configure 'auto-run': false and instead running the download via command manually. Checkout the README here: https://github.com/inpsyde/wp-translation-downloader#commands

Release will hopefully come this week. Depending on feedback from my colleagues ( @tyrann0us ). ;)

Chrico commented 4 years ago

okay, after >100 deploys on real projects, this works pretty stable. Even locally it works command-wise like it should. :-) I created a new release 1.1 which contains those features.

If there is nothing "against" it, i'll close this ticket soon @kraftner / @MaximeCulea ;-)

MaximeCulea commented 4 years ago

:+1: I'll watch if the dev-master change something on my #3 issue. Thx!