Skip to content

Don't download translations more than once a day

I noticed that the recompilation took much longer on my setup than before (50 seconds vs standard 9s) and it's both noticeable and a bit distracting/annoying. It would be always at the [100%] step. I ctrl+C it a few times at the hang and it turned out the script that makes it take so long is the copy_po.py script. It has no conditions to download translations, it just always do that, which is bad for both 1) developers time and 2) bandwidth for both developers and KDE.

"Easy" solution would be to disable downloading translations, but there is a reason it was added.

This MR contains a quick way to reduce the number of downloading by just checking when was the last time it was downloaded, and ensuring it was at least 24h ago.

I'm very open to any suggestions, this is just a quick fix I've found, the MR is mostly done to start a discussion on how this should be done and then implement, the patch I added is just one possibility.

Test Plan

  1. Before this commit: compile Krita. Then recompile Krita. Then recompile Krita again. See that all of those times are similar.
  2. After this commit: compile Krita. Then recompile Krita. Then recompile Krita. See that first compilation after the script changed took around the same time as compilations in 1., but all the next recompilations were much faster.

Formalities Checklist

  • I confirmed this builds.
  • I confirmed Krita ran and the relevant functions work.
  • I tested the relevant unit tests and can confirm they are not broken. (If not possible, don't hesitate to ask for help!)
  • I made sure my commits build individually and have good descriptions as per KDE guidelines.
  • I made sure my code conforms to the standards set in the HACKING file.
  • I can confirm the code is licensed and attributed appropriately, and that unattributed code is mine, as per KDE Licensing Policy.
Edited by Agata Cacko

Merge request reports