NickStarlight commented on issue #7792: Superset seems to be ignoring few 
frontend translations
URL: 
https://github.com/apache/incubator-superset/issues/7792#issuecomment-507648808
 
 
   @mistercrunch No, they are just absent, even for existing languages, the 
add-slice-container itself has no translations being piped to the view, so it's 
an easy task(As described above), however, most parts of the code do not have 
translations mechanisms whatsoever.
   
   1. Tables are using the [humanize](https://github.com/jmoiron/humanize) 
Python lib for human readable time frames(x days ago, x hours ago), i've 
managed to fix this by globally setting the language for humanize:
   
   `humanize.i18n.activate('code', path='path/to/my/translation/')`
   
   We do need to 'compile' new translations for all currently supported 
languages, since humanize is an abandonware.
   
   2. Datetime on Python does not seem to print the localized dates, setting 
the locale globally with `locale.setlocale(locale.LC_ALL, 'i18n_code')` can 
lead to troubles, so more investigations on how properly do it on Superset is 
required.
   
   3.  Moment.js also is absent of any internationalization, importing the 
locale in preamble.js does fix that.
   `import locale from 'moment/locale/i18n_code';`
   
   
   My use case is very specific(One single language support) so all measures 
above work, but unfortunatelly i can't open a PR with those changes since they 
do not match the code quality required on Superset and can lead to trouble in 
the future.

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


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to