feat: bake translations as part of the build processes
There's been some confusion around the state of the translations in the repo as well as within different builds (docker, pypi, official releases,...).
In this PR, we assume that "compiled" or redundant files that can be generated don't belong in the repository, and should be baked as part of the build process.
Done here:
- removed all translation json files from the repo, so the same way as
.mo(binary files compile from .po files, and used by the backend / pybable), .json files (used by the frontend/jed) aren't in the repo anymore - updated CI / docs / docker builds to build the translation the right way, make scripts DRY and referenced the scripts in ci/docs/docker builds
- moved po2json stuff for the frontend under a
npm run build-translationscript so it's bundled with the app in superset-frontend - created an empty language pack for
enthat's empty, as opposed to a large json file of about 200kb that has a map of empty translation, this has a positive impact on the bootstrap payload size in original page load for theenlocale
Tweaked the title. :)
I fear that this won't cover all use cases (e.g. people running from the repo). I suppose this could be done in package.json as part of npm run build and (probably) npm run dev / npm run dev-server to cover all the bases. Those are the processes used when installing superset via docker or otherwise anyway, so it might be a nice catch-all.
I suppose this could be done in package.json
Oh I like the idea of bringing the frontend part in there, looks like there's already other translation-related stuff there we can centralize/simplify
Ready for review!
I just want to test this locally before approving, but this is looking great!!!
@michael-s-molina / @villebro I think this could be considered non-breaking, but do you have any thoughts/objections?
@michael-s-molina @villebro , looking to merge this - let me know if you see any breaking change. Note that I added an entry in UPDATING.md giving a heads up that translations are now bundled.
I think it comes down to - if you build from repo, you have to run an extra [documented] command now. Oh also for apache releases I added a command to run, so as long as the release manager follows instructions we're good.
Just wanted to come in and say I love this, thank you so much for all the effort! It's much appreciated and I look forward to the next release. It's going to make our build process so much easier.