GitHub user imedlee edited a discussion: translation file has not taken effect 
and the chart data is missing in the local language

Hello everyone! Recently, I tried to deploy Superset as a data analysis tool. 
When adding a chart (of table type) and using time comparison for comparative 
analysis, the table automatically generates four columns: SUM(Metrics), #, %, 
and  (empty). Here's my question: SUM(Metrics) allows custom column names. Can 
the #, △, %, and  columns also have their names customized to avoid displaying 
symbols (#, △,% )?

Another issue I'm currently struggling with, which might be a bug, relates to 
the effectiveness of translation files. The master source code has very 
incomplete Chinese localization. I've tried modifying most translations locally 
by converting messages.pot to po files. I built a Docker image using the latest 
master source code's Dockerfile with BUILD_TRANSLATIONS="true" added. The 
messages.mo and messages.json files were successfully compiled in the image. 
However, after running the container, the login page translations didn't take 
effect even when selecting the local language. In the chart editing interface, 
most content still doesn't show translated content, such as Query mode, 
Dimensions, Filters (though translations work when clicking to set content), 
Time Comparison, and condition list content. If I select line chart, some 
content is translated (X-axis, X-Axis Sort By). I checked the messages.po and 
messages.json files, and terms like Query mode, Dimensions, Filters, and Time C
 omparison all have translation content.

However, when I import the same translation files ( messages.mo , messages.json 
) using the apache/superset:5.0.0 image from Docker Hub, the above interface 
translations work correctly:

```dockerfile
FROM apache/superset:5.0.0
COPY messages.json /app/superset/translations/zh/LC_MESSAGES/messages.json
COPY messages.mo /app/superset/translations/zh/LC_MESSAGES/messages.mo
USER root
COPY instantclient-basic-linux.x64-19.27.0.0.0dbru.zip /tmp/oracle/
RUN  apt-get update && \
    ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \
    DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
        libaio1 libpq-dev default-libmysqlclient-dev && \
    apt-get install -y --no-install-recommends --no-install-suggests \
        pkg-config gcc unzip && \
    export PATH="/app/.venv/bin:$PATH" && \
    uv pip install --no-cache-dir \
        cx_Oracle oracledb psycopg2-binary mysqlclient pillow redis authlib \
        -i https://mirrors.aliyun.com/pypi/simple/ && \
    mkdir -p /opt/oracle \
    && unzip /tmp/oracle/instantclient-basic-linux.x64-19.27.0.0.0dbru.zip -d 
/opt/oracle \
    && rm -rf /tmp/oracle \
    && ln -s /opt/oracle/instantclient_19_27 /opt/oracle/instantclient \
    && echo "/opt/oracle/instantclient" > 
/etc/ld.so.conf.d/oracle-instantclient.conf \
    && ldconfig \
    && apt-get purge -y --auto-remove pkg-config gcc unzip && \
    apt-get clean && rm -rf /var/lib/apt/lists/*
USER superset
```
![login](https://github.com/user-attachments/assets/c2b885c3-6143-49bd-9bcc-030e2ebb318a)

![create](https://github.com/user-attachments/assets/a745308d-1bb0-41a3-9e69-1f60951bd1a9)

![table](https://github.com/user-attachments/assets/04c46e79-8901-44be-b349-3e04cb6075da)


But there's another problem: when adding a chart (of table type) and using time 
comparison for analysis, the table automatically generates four columns: Main, 
#,       △, %,. In the new version, SUM(Metrics) has replaced Main. It seems 
Main would extract translation results from the translation file, but this 
causes the entire column of data to be missing. If I switch back to English, it 
displays normally.
![main](https://github.com/user-attachments/assets/5cf37ba9-05d9-49b4-9df2-09c668f98dae)

Thanks to anyone who helped! Thanks a lot!

GitHub link: https://github.com/apache/superset/discussions/34588

----
This is an automatically sent email for notifications@superset.apache.org.
To unsubscribe, please send an email to: 
notifications-unsubscr...@superset.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscr...@superset.apache.org
For additional commands, e-mail: notifications-h...@superset.apache.org

Reply via email to