You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "aprendizlaura (via GitHub)" <gi...@apache.org> on 2024/09/19 08:42:20 UTC
[I] Issues with Language Settings in Superset: Configuration Not Saved, Partial Translations, and Redirects [superset]
aprendizlaura opened a new issue, #30334:
URL: https://github.com/apache/superset/issues/30334
I am experiencing multiple issues related to the language settings in Superset:
1. **Partial Translations and Incorrect Translations**: While testing different languages, I noticed that not all parts of Superset are translated when switching from English to another language. This issue is compounded by incorrect translations, such as those shown in the attached image, where both ascending and descending order options are labeled as "orden descendente" in Spanish. This forces me to revert to English to differentiate between options. I would prefer that parts of Superset remain untranslated rather than being mistranslated.

2. **Language Configuration Not Saved**: When changing the language settings in Superset, the changes are not saved upon closing and reopening the application. For example, if the default language is English and I change it to Spanish, Superset reverts back to English after restarting. Additionally, if I open Superset in a different browser after setting it to Spanish, it also defaults back to English. This becomes problematic when multiple users are involved. If User 1 prefers Spanish and User 2 prefers English, only one default language can be set, requiring one user to change the language every time they log in. The expected behavior is that once a user changes the language setting, it should persist across sessions.
3. **Redirect to Homepage**: When changing the language, Superset redirects the user to the homepage, regardless of the current page. Although I understand that a restart might be necessary for language changes to take effect, it would be more user-friendly if the user remained on the page they were working on after the restart.
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [I] Issues with Language Settings in Superset: Configuration Not Saved, Partial Translations, and Redirects [superset]
Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on issue #30334:
URL: https://github.com/apache/superset/issues/30334#issuecomment-2802617999
Closing this as stale/not-planned since it's been silent for >200 days. That might be because the issue is a bit convoluted. If you are still experiencing any of this (particularly in 4.1.2 or newer) it might be worth opening more granular issues with repro steps we can all follow. Thank you!
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [I] Issues with Language Settings in Superset: Configuration Not Saved, Partial Translations, and Redirects [superset]
Posted by "aprendizlaura (via GitHub)" <gi...@apache.org>.
aprendizlaura commented on issue #30334:
URL: https://github.com/apache/superset/issues/30334#issuecomment-2370361852
@rusackas Great! I’ll keep that in mind for next time and present the issues separately. Since they all relate to a common theme, I thought it made sense to present them together, but now that you mention it, you’re absolutely right to address them separately. Going back to the topic of partial translations, it’s not really the main issue I see. The bigger problem, in my opinion, is incorrect translations. As I’ve attached in the image, you can see that for ascending and descending order, it shows the same text for both, in this case, descending order. I’ve found myself more than once having to change the language because the translation wasn’t correct. What I mean is, partial translations seem great to me, and actually, being in English right now seems the most optimal at this stage of the language development.
Thank you so much, as always, for your responses!
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [I] Issues with Language Settings in Superset: Configuration Not Saved, Partial Translations, and Redirects [superset]
Posted by "aprendizlaura (via GitHub)" <gi...@apache.org>.
aprendizlaura commented on issue #30334:
URL: https://github.com/apache/superset/issues/30334#issuecomment-2362955163
@Suvendu-UI No, it hasn't been resolved. The issue that concerns me the most is the first one, and even with the configuration that Dosu suggested (which I already had because I read other threads), it still works partially.
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [I] Issues with Language Settings in Superset: Configuration Not Saved, Partial Translations, and Redirects [superset]
Posted by "SBIN2010 (via GitHub)" <gi...@apache.org>.
SBIN2010 commented on issue #30334:
URL: https://github.com/apache/superset/issues/30334#issuecomment-2380618920
[aprendizlaura](https://github.com/aprendizlaura)
I suggest this option, it suits me, maybe it will suit you too. This solves the problem with redirection and language change
Add it to config.py:
```
class SupersetIndexView(IndexView):
@expose("/lang/<string:locale>")
def patch_flask_locale(self, locale):
from flask import redirect, request, session
referrer = request.headers.get("Referer")
session["locale"] = locale
return redirect(referrer)
FAB_INDEX_VIEW = f"{SupersetIndexView.__module__}.{SupersetIndexView.__name__}"
```
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [I] Issues with Language Settings in Superset: Configuration Not Saved, Partial Translations, and Redirects [superset]
Posted by "dosubot[bot] (via GitHub)" <gi...@apache.org>.
dosubot[bot] commented on issue #30334:
URL: https://github.com/apache/superset/issues/30334#issuecomment-2360387638
<!-- Answer -->
I found some similar issues and discussions that might help address the problems you're facing with language settings in Superset:
1. **Partial and Incorrect Translations**:
- There are open issues related to translation problems, such as [Some items are not translated in French](https://github.com/apache/superset/issues/21493) and [plz help me with language translation](https://github.com/apache/superset/issues/25406) <sup>[[1]](https://github.com/apache/superset/issues/21493)</sup><sup>[[2]](https://github.com/apache/superset/issues/25406)</sup>.
- A closed issue, [Superset translation native filters bug](https://github.com/apache/superset/issues/17779), was resolved by a pull request that fixed translations related to the date range filter <sup>[[3]](https://github.com/apache/superset/issues/17779)</sup>.
2. **Language Configuration Not Saved**:
- Language preferences are stored in the session under the key `"locale"`, defaulting to `"en"` if not set. This means the language setting is not persistent across different sessions or browsers <sup>[[4]](https://github.com/apache/superset/blob/master/superset/views/base.py)</sup>.
- To make language settings persistent, you might need to implement backend changes to save the language preference in the user profile or a database.
3. **Redirect to Homepage**:
- The current implementation for handling language changes involves reloading the page, which causes a redirect to the homepage. This is done through a language picker dropdown in the frontend <sup>[[5]](https://github.com/apache/superset/blob/master/superset-frontend/src/setup/setupApp.ts)</sup>.
### Suggested Solutions:
1. **Partial and Incorrect Translations**:
- Ensure that the `BABEL_DEFAULT_LOCALE` is set correctly and that the `LANGUAGES` dictionary is populated with the supported languages and their respective flags and names.
- Verify that the translation files (`.po`, `.mo`, `.json`) are correctly updated and placed in the appropriate directory.
```python
# Babel config for translations
BABEL_DEFAULT_LOCALE = "en"
BABEL_DEFAULT_FOLDER = "superset/translations"
LANGUAGES = {
"en": {"flag": "us", "name": "English"},
"es": {"flag": "es", "name": "Spanish"},
"it": {"flag": "it", "name": "Italian"},
"fr": {"flag": "fr", "name": "French"},
"zh": {"flag": "cn", "name": "Chinese"},
"zh_TW": {"flag": "tw", "name": "Traditional Chinese"},
"ja": {"flag": "jp", "name": "Japanese"},
"de": {"flag": "de", "name": "German"},
"pt": {"flag": "pt", "name": "Portuguese"},
"pt_BR": {"flag": "br", "name": "Brazilian Portuguese"},
"ru": {"flag": "ru", "name": "Russian"},
"ko": {"flag": "kr", "name": "Korean"},
"sk": {"flag": "sk", "name": "Slovak"},
"sl": {"flag": "si", "name": "Slovenian"},
"nl": {"flag": "nl", "name": "Dutch"},
"uk": {"flag": "uk", "name": "Ukranian"},
}
```
2. **Language Configuration Not Saved**:
- Modify the backend to save the language preference in the user profile or a database, ensuring it persists across sessions and browsers.
3. **Redirect to Homepage**:
- Update the frontend logic to reload the page without redirecting to the homepage. This might involve modifying the language change handler to retain the current page URL.
```ts
// Example: Retain current page after language change
$('#language-picker a').click(function (ev) {
ev.preventDefault();
SupersetClient.get({
url: ev.currentTarget.href,
parseMethod: null,
}).then(() => {
window.location.reload(true); // true to force reload from server
});
});
```
By implementing these changes, you can address the issues of partial and incorrect translations, unsaved language configurations, and homepage redirects in Superset.
<!-- Dosu Comment Footer -->
*To continue talking to [Dosu](https://dosu.dev), mention @dosu.*
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [I] Issues with Language Settings in Superset: Configuration Not Saved, Partial Translations, and Redirects [superset]
Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on issue #30334:
URL: https://github.com/apache/superset/issues/30334#issuecomment-2368892102
Partial translations are not considered bugs, as we'll be chasing that down approximately forever. If you'd like to contribute or fix translations, we encourage you to edit the `.po` files and open a PR with your changes.
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [I] Issues with Language Settings in Superset: Configuration Not Saved, Partial Translations, and Redirects [superset]
Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas closed issue #30334: Issues with Language Settings in Superset: Configuration Not Saved, Partial Translations, and Redirects
URL: https://github.com/apache/superset/issues/30334
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [I] Issues with Language Settings in Superset: Configuration Not Saved, Partial Translations, and Redirects [superset]
Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on issue #30334:
URL: https://github.com/apache/superset/issues/30334#issuecomment-2368898932
I haven't looked much at the other two issues, but the second one sounds legit, and maybe you can set a cookie or use localstorage to resolve this. The third, I believe, is a duplicated of another open issue. If you or I find that, we _might_ want to close this as a duplicate... I'd encourage you to file issues separately for reasons like this :)
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [I] Issues with Language Settings in Superset: Configuration Not Saved, Partial Translations, and Redirects [superset]
Posted by "Suvendu-UI (via GitHub)" <gi...@apache.org>.
Suvendu-UI commented on issue #30334:
URL: https://github.com/apache/superset/issues/30334#issuecomment-2361290038
is this issue resolved?
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org