Superset seems to be ignoring few frontend translations
See original GitHub issueSuperset 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:
- Created 4 years ago
- Reactions:2
- Comments:5 (1 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@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.
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.
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.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.
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.