superset
superset copied to clipboard
Although defined, some elements are not translated
Hello, I had created an issue (https://github.com/apache/superset/issues/21493) but it has multiples cause of no translation. I specialise this issue on elements not translated although defined
It's not just a lack of traduction
Items are :
- "Dashboards": ["Tableaux de bord"],
- "Charts": ["Graphiques"],
- "Datasets": ["Jeux de données"],
- "Saved Queries": ["Requêtes sauvegardées"],
- "Query History": ["Historiques des requêtes"],
- "Action Log": ["Journaux d'actions"],
- "Annotation layers": ["Couches d'annotations"],
- "CSS template": ["Templates CSS"],
- "Row Level Security": ["Sécurité de niveau ligne"],
- "Alerts & Reports": ["Alertes et rapports"],
- "Refresh": ["Forcer à rafraîchir"],
- "Report name": ["Nom du rapport"],
Screenshot :
The french translation are not applied.
Best regard
I use Supserset in version 3.0.0
Hi @xavier-GitHub76
I've found that the menu items are populated from the backend, not the front-end. So the translated values must be in the .mo file, not the .json file.
Hope that helps!
@xavier-GitHub76 I noticed that if you run pybabel compile -d superset/translations it will create/update the messages.mo files and then the navbar is correctly translated.
This is related to the issue #26738 There are no messages.mo files in the docker container so no translations related to FAB !
I'm not sure how we ought to handle this, really, but I suspect it's quietly affecting a lot of people that just don't realize it. Should we auto-generate the .mo files again? I'm not sure the advantage/history of why those are currently not included... just file size? I think @mistercrunch knows the history on their removal, but I'm not sure anyone's feelings for or against reintroducing them.
Also curious if people think we should leave this open (since it's kind of a bug) or close this out in favor of the open Discussion.
I'm thinking we should add the .mo and .json file build as part of the docker and pypi builds, and keep these files out of the repo.
I wonder if we could even generate them at start time, since (as I recall) they're pretty slow. If we do that, then it's not a breaking change, the repo gets lighter, and the translations will be up to date every time the code changes.
at 10-20 seconds each (pybabel and po2json) I think it's a bit slow to force that on web-server start, plus there are many ways to start the web server, and many people don't care for all or some of the translations...
I think this fits perfectly in a docker build and/or pypi build steps, though it does add a bit of weights to the images/bundles (about 8mb) which I think is totally fine
True... though npm run build already takes approximately forever. 10 more seconds there might not be the end of the world, if it centralizes the task for docker/pypi/local use cases.
Wait but the built frontend assets are bundled in the python package, meaning if you get the package you don't need to have node/npm, run npm i, npm run build, ... Should be prepackaged.
I guess similarly here we can compile and package .po+.json, and people don't have to have all that extra junk (npm / po2json / pybabel / ...). Also doesn't seem good practice (is it even allowed) to mutate the package in place post install. I think you'd be supposed to do this in home somewhere like ~/.superset/ ...
Right, the npm/webpack built assets are indeed included in the python package... which I thought was done via npm run build anyway... so it'd just be shifting it to that NPM process. This would just have the benefit for people cloning the repo from github, so they could just run npm run build to have the assets in their local builds. Doing so on npm run dev(-server) seems a bit heavy-handed, but also seems useful for those contributing translations. The NPM script might even be able to check if you have translations turned on, and only run it if relevant. Maybe this is a good topic to discuss more synchronously :) It'd be great to get it all straightened out one way or another! :D
My proposal to improve things around translations -> https://github.com/apache/superset/pull/28483