Incubator-superset: Superset seems to be ignoring few frontend translations

Created on 28 Jun 2019  路  5Comments  路  Source: apache/incubator-superset

Superset internationalization does not seem to be working on few components at the frontend.
The 'Add new slice' menu @ superset/assets/src/addSlice/AddSliceContainer.jsx is one example, even if the @superset-ui module has been called.

import { t } from '@superset-ui/translation';
t('Choose a datasource')

Expected results

All UI elements should be translated.

Actual results

Few frontend elements seem to ignore the translation, i couldn't reproduce the issue on backend rendered components like tables.

How to reproduce the bug

Download the current main branch, or 0.32.0rc2, haven't tested on other releases.

Environment

(please complete the following information):

  • superset version: 0.32.0rc2
  • python version: 3.6
  • node.js version: 12.0

Checklist

  • [*] I have checked the superset logs for python stacktraces and included it here as text if there are 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.
#bug inactive

All 5 comments

Issue-Label Bot is automatically applying the label #bug to this issue, with a confidence of 0.94. Please mark this comment with :thumbsup: or :thumbsdown: to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

Replicating the exact same code as described here, fixes the issue partially.

Could it be that some of the translations have not been "compiled"?
https://github.com/apache/incubator-superset/blob/master/CONTRIBUTING.md#creating-a-new-language-dictionary

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

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

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

john-bodley picture john-bodley  路  3Comments

ghost picture ghost  路  3Comments

gbrian picture gbrian  路  3Comments

tmccartan picture tmccartan  路  3Comments

deity-bram picture deity-bram  路  3Comments