gabriela-schuster opened a new issue, #35330:
URL: https://github.com/apache/superset/issues/35330

   ### Bug description
   
   Title: Partial Portuguese translations in Superset 6.0.0rc1 despite 
BABEL_DEFAULT_LOCALE configuration
   
   Body:
   Describe the bug
   After configuring BABEL_DEFAULT_LOCALE = "pt_BR" in superset_config.py and 
compiling translations manually, some UI elements are still displayed in 
English while others appear in Portuguese. This occurs on Superset 6.0.0rc1.
   
   To Reproduce
   Steps to reproduce the behavior:
   
   1. Use the Docker setup:
   
   ```
   superset:
       image: apache/superset:6.0.0rc1
       container_name: superset
       restart: always
       build:
         context: .docker/superset
         dockerfile: Dockerfile
       args:
           BUILD_TRANSLATIONS: true
       environment:
         - SUPERSET_LOAD_EXAMPLES=no
         - SUPERSET_CONFIG_PATH=/app/superset_config.py
       ports:
         - "8088:8088"
       depends_on:
         - postgres
       volumes:
         - ./.docker/superset/superset_config.py:/app/superset_config.py
       env_file:
         - ./envs/.superset.env
       command: >
         bash -c "
           superset db upgrade &&
           superset run -h 0.0.0.0 -p 8088
         "
   ```
   
   2. In `superset_config.py`:
   ```
   BABEL_DEFAULT_LOCALE = "pt_BR"
   BABEL_DEFAULT_TIMEZONE = "America/Sao_Paulo"
   LANGUAGES = {
       "en": {"flag": "us", "name": "English"},
       "pt_BR": {"flag": "br", "name": "Português (Brasil)"},
   }
   
   from superset.translations.utils import get_language_pack
   
   def override_bootstrap_locale(data):
       if data.get("locale") == "pt":
           data["locale"] = "pt_BR"
           data["language_pack"] = get_language_pack('pt_BR')
       return data
   
   COMMON_BOOTSTRAP_OVERRIDES_FUNC = override_bootstrap_locale
   ```
   
   3. Copy and compile translations:
   ```
   docker exec -it superset bash -c "pybabel compile -d 
/app/superset/translations"
   ```
   
   4. Restart Superset and check UI
   Expected behavior
   All UI elements should be displayed in Portuguese (pt_BR).
   
   Actual behavior
   Only some parts of the UI are translated; other strings remain in English. 
The issue is more noticeable in frontend React elements like dashboards, menus, 
and table headers.
   
   
   ### Screenshots/recordings
   
   <img width="1303" height="759" alt="Image" 
src="https://github.com/user-attachments/assets/54390bf1-5a4d-4a37-8205-ccc69ec5b677";
 />
   
   <img width="1302" height="747" alt="Image" 
src="https://github.com/user-attachments/assets/e6a43d4f-fe9a-45dc-b975-3665a3f9e1a4";
 />
   
   <img width="1115" height="191" alt="Image" 
src="https://github.com/user-attachments/assets/3a4af94b-9277-4caa-b407-0e9dd019d8aa";
 />
   
   ### Superset version
   
   master / latest-dev
   
   ### Python version
   
   3.11
   
   ### Node version
   
   16
   
   ### Browser
   
   Chrome
   
   ### Additional context
   
   Container: apache/superset:6.0.0rc1
   
   Translations compiled from 
/app/superset/translations/pt_BR/LC_MESSAGES/messages.po
   
   Partial translations may be caused by missing or incompatible frontend 
translation JSON files.
   
   ### Checklist
   
   - [ ] I have searched Superset docs and Slack and didn't find a solution to 
my problem.
   - [ ] I have searched the GitHub issue tracker and didn't find a similar bug 
report.
   - [ ] I have checked Superset's logs for errors and if I found a relevant 
Python stacktrace, I included it here as text in the "additional context" 
section.


-- 
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