apache / superset

Apache Superset is a Data Visualization and Data Exploration Platform
https://superset.apache.org/
Apache License 2.0
61.9k stars 13.56k forks source link

Superset v0.24.0 translation for Chinese language is broken for Chart menu part #4822

Closed CasperLiu closed 5 years ago

CasperLiu commented 6 years ago

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

Superset version

v0.24.0

Expected results

Thanks a lot for the great Superset team to provide brilliant functionalities, and features continuously! Background, in our company we are popularize Superset to finance division, so I am doing Chinese translation work based on v0.24.0. I know github repo already has a Chinese translation, and I'd like to expect: the Chinese messages could be shown on Superset webpage, especially the menu implemented by React, so that users could have a better understanding of how to use Superset.

Actual results

With Superset v0.24.0, even if we have switched to Chinese locale on the Superset webpage, user still cannot see Chinese translation content on the chart menu part. So the Chinese translation part is broken in v0.24.0.

Steps to reproduce

  1. Open Superset webpage, and switch to Chinese locale on the top-right button of the webpage.
  2. Open a Chart(Slice), check the left part of the webpage and see it is still Englis prompt, no Chinese messages.

Below is what I have seen after the above reproducing: Top bar menus are good in Chinese, but left menus are still in English(PS: the left menus indeed have Chinese translation in superset/translations/zh/LC_MESSAGES/messages.po/json

image

Below is how I solve the Chinese translation missing issue: I followed below procedure guide and I have the Chinese translation worked for Chart menu part. https://github.com/apache/incubator-superset/blob/master/CONTRIBUTING.md#translations

  1. Go to top directory of superset directory. (venv) [root@centos4 site-packages]# pwd /root/Dev/Superset/venv/lib/python2.7/site-packages
  2. Modify babel.cfg to add static for js/jsx path, OTHERWISE "fabmanager babel-extract" will NOT extract the messages for translation in js/jsx files.

A big question, why there is NO static in the github repo? Without the static in https://github.com/apache/incubator-superset/blob/master/superset/translations/babel.cfg, how could the messages in js/jsx be extracted? Could you please help answer?

(venv) [root@centos4 translations]# cat babel.cfg [ignore: superset/assets/node_modules/**] [python: superset/**.py] [jinja2: superset/**/templates/**.html] [javascript: superset/static/assets/javascripts/**.js] [javascript: superset/static/assets/javascripts/**.jsx] [javascript: superset/static/assets/visualizations/**.js] [javascript: superset/static/assets/visualizations/**.jsx] encoding = utf-8

  1. Extract the messages marked for translation (venv) [root@centos4 site-packages]# fabmanager babel-extract --target superset/translations/ --output superset/translations/messages.pot --config superset/translations/babel.cfg -k _ -k __ -k t -k tn -k tct
  2. Compile and generate json file. (venv) [root@centos4 site-packages]# fabmanager babel-compile --target superset/translations/ (venv) [root@centos4 site-packages]# po2json -d superset -f jed1.x superset/translations/zh/LC_MESSAGES/messages.po
  3. Restart Superset and select Chinese locale.

After above operation, the translation messages could been seen on menu, as below: image

If needed, I could contribute to solve this issue for Chinese locale, and submit to Superset github repo and catch a patch or later release, since I am familiar with Chinese. Please don't hesitate if anything needed!

Thanks a lot in advance!

Regards, Jiaxu 刘佳旭

xrmx commented 6 years ago

When doing development work you should work on a git checkout and not on an installed superset :) Said that looking forward to your PR!

mistercrunch commented 6 years ago

Just FYI translations / i18n is mostly community contributed and not a top priority for the core committers. Though we're happy to enable others to translate and make translations work.

doubaojun commented 6 years ago

@CasperLiu Hello, please, why do I follow your steps in the result of translation, the result still is English, I'm doing the third step: Extract the messages marked for translation (venv) [root@centos4 site-packages]# fabmanager babel-extract --target superset/translations/ --output superset/translations/messages.pot --config superset/translations/babel.cfg -k _ -k __ -k t -k tn -k tct It's running all the time,I stopped by direct ctrl+c;

Fourth steps :(venv) [root@centos4 site-packages]# fabmanager babel-compile --target superset/translations/ It's running all the time,I stopped by direct ctrl+c;

Is it related to this again? How long will the two orders be carried out

qin4zhang commented 6 years ago

@CasperLiu Have you solved it?

mistercrunch commented 6 years ago

Looks like translations stopped working somewhere between 0.25.6 and 0.26.0rc1

mistercrunch commented 6 years ago

I think https://github.com/apache/incubator-superset/pull/5008 broke translations

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. For admin, please label this issue .pinned to prevent stale bot from closing the issue.

umesh11111 commented 4 years ago

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

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

Superset version

v0.24.0

Expected results

Thanks a lot for the great Superset team to provide brilliant functionalities, and features continuously! Background, in our company we are popularize Superset to finance division, so I am doing Chinese translation work based on v0.24.0. I know github repo already has a Chinese translation, and I'd like to expect: the Chinese messages could be shown on Superset webpage, especially the menu implemented by React, so that users could have a better understanding of how to use Superset.

Actual results

With Superset v0.24.0, even if we have switched to Chinese locale on the Superset webpage, user still cannot see Chinese translation content on the chart menu part. So the Chinese translation part is broken in v0.24.0.

Steps to reproduce

  1. Open Superset webpage, and switch to Chinese locale on the top-right button of the webpage.
  2. Open a Chart(Slice), check the left part of the webpage and see it is still Englis prompt, no Chinese messages.

Below is what I have seen after the above reproducing: Top bar menus are good in Chinese, but left menus are still in English(PS: the left menus indeed have Chinese translation in superset/translations/zh/LC_MESSAGES/messages.po/json

image

Below is how I solve the Chinese translation missing issue: I followed below procedure guide and I have the Chinese translation worked for Chart menu part. https://github.com/apache/incubator-superset/blob/master/CONTRIBUTING.md#translations

  1. Go to top directory of superset directory. (venv) [root@centos4 site-packages]# pwd /root/Dev/Superset/venv/lib/python2.7/site-packages
  2. Modify babel.cfg to add static for js/jsx path, OTHERWISE "fabmanager babel-extract" will NOT extract the messages for translation in js/jsx files.

A big question, why there is NO static in the github repo? Without the static in https://github.com/apache/incubator-superset/blob/master/superset/translations/babel.cfg, how could the messages in js/jsx be extracted? Could you please help answer?

(venv) [root@centos4 translations]# cat babel.cfg [ignore: superset/assets/node_modules/] [python: superset/.py] [jinja2: superset//templates/.html] [javascript: superset/static/assets/javascripts/.js] [javascript: superset/static/assets/javascripts/.jsx] [javascript: superset/static/assets/visualizations/.js] [javascript: superset/static/assets/visualizations/.jsx] encoding = utf-8

  1. Extract the messages marked for translation (venv) [root@centos4 site-packages]# fabmanager babel-extract --target superset/translations/ --output superset/translations/messages.pot --config superset/translations/babel.cfg -k _ -k __ -k t -k tn -k tct
  2. Compile and generate json file. (venv) [root@centos4 site-packages]# fabmanager babel-compile --target superset/translations/ (venv) [root@centos4 site-packages]# po2json -d superset -f jed1.x superset/translations/zh/LC_MESSAGES/messages.po
  3. Restart Superset and select Chinese locale.

After above operation, the translation messages could been seen on menu, as below: image

If needed, I could contribute to solve this issue for Chinese locale, and submit to Superset github repo and catch a patch or later release, since I am familiar with Chinese. Please don't hesitate if anything needed!

Thanks a lot in advance!

Regards, Jiaxu 刘佳旭

hi, i have tried in .33 version of superset,but its not working.can you please help me on this