superset icon indicating copy to clipboard operation
superset copied to clipboard

how to achieve multi-language with exploreV2

Open ujhujuh opened this issue 9 years ago • 7 comments

Make sure these boxes are checked before submitting your issue - thank you!

  • [ true] I have checked the superset logs for python stacktraces and included it here as text if any
  • [ true] I have reproduced the issue with at least the latest released version of superset
  • [true ] I have checked the issue tracker for the same issue and I haven't found one similar

Superset version

15

Expected results

explore V2 Can achieve multi-language

Actual results

can not

Steps to reproduce

ujhujuh avatar Jan 09 '17 01:01 ujhujuh

We've started moving UI to react/JS and using single page apps for both explore V2 and SQL Lab. Currently we don't have support for translations on the front end, and have yet to come up with a pattern of getting translated strings from the server to the front end.

ascott avatar Jan 11 '17 06:01 ascott

One first step is to wrap all the strings on the frontend with something like gettext on the python side, as in _('Translate this string'). I heard webpack can help with extracting the strings, then it'd be a matter of feeding that to [python's] babel somehow. An obvious optimization is to only send the translations needed by the user, I'd guess that webpack can create an entry file for each language.

Unfortunately it's not super high priority for us though, so we probably won't drive this and act more as enablers.

mistercrunch avatar Jan 11 '17 16:01 mistercrunch

@YinghaoPu wrote in #2002:

As I know, superset can translate the words in .html and .py file easily, but the words in .js or .jsx can't be translated. I found a solution in http://www.obviel.org/en/1.0b/i18n.html, and I try it locally, it works. but everytime I merge the newest code from your repository, it takes lots of time. Could you please add this found to your code?

xrmx avatar Jan 19 '17 09:01 xrmx

Let me link this on how sentry (python + react frontend) does this: https://blog.sentry.io/2016/01/07/react-i18n

xrmx avatar Jul 05 '17 09:07 xrmx

We have done this, and in superset/superset/assets/javascripts/explore/stores added some resource files, the realization of the page of Chinese.Such as the following page. default

lxzhangchao avatar Jul 05 '17 09:07 lxzhangchao

@lxzhangchao then open a PR to contribute the work back or i don't see what we are discussing here :)

xrmx avatar Jul 05 '17 09:07 xrmx

Notice: this issue has been closed because it has been inactive for 291 days. Feel free to comment and request for this issue to be reopened.

mistercrunch avatar Apr 23 '18 05:04 mistercrunch