PolinaFam opened a new pull request, #34051:
URL: https://github.com/apache/superset/pull/34051

   ### SUMMARY
   **Issue Description**
   Switching the language to English does not fully apply, leaving some 
time-related strings in the previous language. All untranslated time-related 
strings are created by dayjs and humanize libraries.
   
   **Solution**
   Fix dayjs strings: move all dayjs locale imports from `useLocale.ts` hook to 
`preamble.ts`. Without them, `dayjs.locale()` calls have no effect, leaving 
dates/times in the default language.
   Fix humanized strings: translate `changed_on_humanized` and 
`created_on_humanized` using current locale from flask_babel.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   
![screenshot3](https://github.com/user-attachments/assets/2464d9fb-f43c-4e0e-8bc0-f81ebbd8a61c)
   
![screenshot4](https://github.com/user-attachments/assets/8b50411b-19f0-4fea-b806-5c0a03c26b09)
   
   ### TESTING INSTRUCTIONS
   1. Add next lines to config file:
   ```py
   BABEL_DEFAULT_LOCALE` = "ru"
   LANGUAGES = {
     "ru": {"flag": "ru", "name": "Русский"},
     "en": {"flag": "us", "name": "English"}
   }
   ```
   2. Start the application.
   3. Switch the interface language to English.
   4. Verify the translations.
   
   ### ADDITIONAL INFORMATION
   - [x] Has associated issue: Fixes #33630, #7792
   - [ ] Required feature flags:
   - [ ] Changes UI
   - [ ] Includes DB Migration (follow approval process in 
[SIP-59](https://github.com/apache/superset/issues/13351))
     - [ ] 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
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to