CasperLiu opened a new issue #4822: Superset v0.24.0 Locale for Chinese 
language is broken for Chart menu part(controlled by js/jsx)
URL: https://github.com/apache/incubator-superset/issues/4822
 
 
   Make sure these boxes are checked before submitting your issue - thank you!
   
   - [ ] I have checked the superset logs for python stacktraces and included 
it here as text if any
   - [ ] I have reproduced the issue with at least the latest released version 
of superset
   - [ ] I have checked the issue tracker for the same issue and I haven't 
found one similar
   
   
   ### Superset version
   v0.24.0
   
   ### Expected results
   
   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 Web GUI, 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](https://user-images.githubusercontent.com/6135084/38719733-078eee72-3f26-11e8-84b6-e5348f739874.png)
   
   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
   
   3. 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
   4. 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
   5. Restart Superset and select Chinese locale.
   
   After above operation, the translation messages could been seen on menu, as 
below:
   
![image](https://user-images.githubusercontent.com/6135084/38720351-89ae9248-3f28-11e8-9a8f-29551e2725cd.png)
   
   If needed, I could contribute to solve this issue for Chinese locale, and 
submit to Superset repo and catch a 0.24.0 stream patch or later release, since 
I am familiar with Chinese.
   Please don't hesitate if anything needed! :)
   
   Thanks a lot in advance!
   
   Regards,
   Jiaxu
   刘佳旭

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to