superset icon indicating copy to clipboard operation
superset copied to clipboard

fix(translations): Fix language switching when default language is not English

Open Lksen1a opened this issue 1 year ago • 1 comments

SUMMARY

In Flask App Builder, menu translation is already integrated using the label field. However, in Apache Superset, during the initial setup, the label field was translated according to the default language. Upon switching to a different language, the system attempted to translate the already translated value. Since the translated key (in this case, Russian) did not exist in the dictionary, this caused an issue. Therefore, I removed the translation from the application initialization process.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Screencastfrom26 08 2024211640-ezgif com-video-to-gif-converter (1) Screencastfrom26 08 2024211805-ezgif com-video-to-gif-converter (1)

TESTING INSTRUCTIONS

  1. Set BABEL_DEFAULT_LOCALE = "ru".
  2. Start the application.
  3. Switch the interface language to English.
  4. Verify the translations.

ADDITIONAL INFORMATION

  • [x] Has associated issue: Fixes #29882
  • [ ] Required feature flags:
  • [ ] Changes UI
  • [ ] Includes DB Migration (follow approval process in SIP-59)
    • [ ] Migration is atomic, supports rollback & is backwards-compatible
    • [ ] Confirm DB migration upgrade and downgrade tested
    • [ ] Runtime estimates and downtime expectations provided
  • [ ] Introduces new feature or API
  • [ ] Removes existing feature or API

Lksen1a avatar Aug 26 '24 18:08 Lksen1a

Codecov Report

:white_check_mark: All modified and coverable lines are covered by tests. :white_check_mark: Project coverage is 83.65%. Comparing base (76d897e) to head (e6f9cdb). :warning: Report is 2556 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff             @@
##           master   #30015       +/-   ##
===========================================
+ Coverage   60.48%   83.65%   +23.16%     
===========================================
  Files        1931      528     -1403     
  Lines       76236    38205    -38031     
  Branches     8568        0     -8568     
===========================================
- Hits        46114    31959    -14155     
+ Misses      28017     6246    -21771     
+ Partials     2105        0     -2105     
Flag Coverage Δ
hive ∅ <ø> (∅)
javascript ?
postgres ∅ <ø> (?)
presto ∅ <ø> (∅)
python ∅ <ø> (∅)
sqlite ∅ <ø> (?)
unit ∅ <ø> (∅)

Flags with carried forward coverage won't be shown. Click here to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

codecov[bot] avatar Aug 27 '24 03:08 codecov[bot]

Associated issue is marked fixed, closing this one but thanks!

msyavuz avatar Sep 22 '25 11:09 msyavuz