question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Superset seems to be ignoring few frontend translations

See original GitHub issue

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.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
NickStarlightcommented, Jul 2, 2019

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

1reaction
issue-label-bot[bot]commented, Jun 28, 2019

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

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

Superset seems to be ignoring few frontend translations #7792
Few frontend elements seem to ignore the translation, i couldn't reproduce the issue on backend rendered components like tables. How to ...
Read more >
Translating - Apache Superset
We use Flask-Babel to translate Superset. In Python files, we use the following translation functions from Flask-Babel : gettext and lazy_gettext (usually ...
Read more >
CONTRIBUTING.md · superset-helm-chart-0.3.5 · mirrors / apache ...
Apache Superset is a Data Visualization and Data Exploration Platform Github ... Note that for some legacy pages there are additional frontend assets ......
Read more >
“Clang” CFE Internals Manual — Clang 6 documentation - API Manual
This document describes some of the more important APIs and internal design decisions made in the Clang C front-end. The purpose of this...
Read more >
Building Custom Viz Plugins in Superset v1 - Preset.io
Open a terminal window to incubator-superset/superset-frontend . If you did the Install Superset steps above, you may still have webpack ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found