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

   … when a non‑English language is selected
   
   ### SUMMARY
   Call `setupFormatters` synchronously so that the custom D3_FORMAT is applied 
when a non‑English language is selected. See related issue #35524 for more 
details.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   BEFORE
   
![1_1](https://github.com/user-attachments/assets/7e8a0bd1-c8bb-446c-88ce-3281f0a98ccb)
   
   AFTER
   
![1_2](https://github.com/user-attachments/assets/12a4461a-c3a1-4eca-af63-04030a70fcf0)
   
   ### TESTING INSTRUCTIONS
   1. In config.py set the LANGUAGES and D3_FORMAT variables, for example:
   ```
   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"},/
       "pl": {"flag": "pl", "name": "Polish"},
       "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"},
   }
   
   class D3Format(TypedDict, total=False):
       decimal: str
       thousands: str
       grouping: list[int]
       currency: list[str]
   
   
   D3_FORMAT: D3Format = {
     "decimal": ",",
     "thousands": "\u00a0",
     "grouping": [3],
     "currency": ["", "\u00a0\u20bd"]
   }
   ```
   2. Open Superset, switch the UI language to any language other than English 
(e.g., Spanish, French, etc.).
   3. Observe the number formatting on charts and tables.
   
   
   ### ADDITIONAL INFORMATION
   <!--- Check any relevant boxes with "x" -->
   <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
   - [x] Has associated issue: #35524
   - [ ] 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