Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Although defined, some elements are not translated #25988

Open
xavier-GitHub76 opened this issue Nov 15, 2023 · 12 comments
Open

Although defined, some elements are not translated #25988

xavier-GitHub76 opened this issue Nov 15, 2023 · 12 comments

Comments

@xavier-GitHub76
Copy link
Contributor

Hello,
I had created an issue (#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

image

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 :
image

The french translation are not applied.

Best regard

@xavier-GitHub76
Copy link
Contributor Author

I use Supserset in version 3.0.0

@Ralkion
Copy link
Contributor

Ralkion commented Nov 15, 2023

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!

@qleroy
Copy link
Contributor

qleroy commented Jan 21, 2024

@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.

@qleroy
Copy link
Contributor

qleroy commented Jan 23, 2024

This is related to the issue #26738
There are no messages.mo files in the docker container so no translations related to FAB !

@rusackas
Copy link
Member

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.

@mistercrunch
Copy link
Member

mistercrunch commented May 13, 2024

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.

@rusackas
Copy link
Member

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.

@mistercrunch
Copy link
Member

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

@rusackas
Copy link
Member

rusackas commented May 14, 2024

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.

@mistercrunch
Copy link
Member

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/ ...

@rusackas
Copy link
Member

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

@mistercrunch
Copy link
Member

My proposal to improve things around translations -> #28483

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants