Superset2.0.1这个版本安装完是没有多语言选择功能的所以我们通过文件配置增加这个功能找到自己的superset的目录我的是在/opt/module/miniconda3/envs/superset/找不到目录的可以通过locate /superset命令查找创建文件 superset_config.pyvim superset_config.py文件内容如下BABEL_DEFAULT_LOCALE zh LANGUAGES { en: {flag: us, name: English}, zh: {flag: cn, name: 中文}, }Esc :wq 保存退出重新编译翻译文件必做修改配置后必须重新编译.mo二进制翻译文件否则新配置不会生效pybabel compile -d /opt/module/miniconda3/envs/superset/lib/python3.8/site-packages/superset/translations成功标志输出中包含compiling catalog .../zh/LC_MESSAGES/messages.po to .../messages.mo过程中出现的 200 条 warnings 是正常的无需担心。重启 Superset 服务superset.sh start脚本内容如下#!/bin/bash superset_status(){ resultps -ef | awk /gunicorn/ !/awk/{print $2} | wc -l if [[ $result -eq 0 ]]; then return 0 else return 1 fi } superset_start(){ source ~/.bashrc superset_status /dev/null 21 if [[ $? -eq 0 ]]; then conda activate superset ; gunicorn --workers 5 --timeout 120 --bind hadoop101:8787 --daemon superset.app:create_app() else echo superset正在运行 fi } superset_stop(){ superset_status /dev/null 21 if [[ $? -eq 0 ]]; then echo superset未在运行 else ps -ef | awk /gunicorn/ !/awk/{print $2} | xargs kill -9 fi } case $1 in start ) echo 启动Superset superset_start ;; stop ) echo 停止Superset superset_stop ;; restart ) echo 重启Superset superset_stop superset_start ;; status ) superset_status /dev/null 21 if [[ $? -eq 0 ]]; then echo superset未在运行 else echo superset正在运行 fi esac汉化完成
【Superset 汉化】完整解决方案 实测有效!
发布时间:2026/7/18 4:08:15
Superset2.0.1这个版本安装完是没有多语言选择功能的所以我们通过文件配置增加这个功能找到自己的superset的目录我的是在/opt/module/miniconda3/envs/superset/找不到目录的可以通过locate /superset命令查找创建文件 superset_config.pyvim superset_config.py文件内容如下BABEL_DEFAULT_LOCALE zh LANGUAGES { en: {flag: us, name: English}, zh: {flag: cn, name: 中文}, }Esc :wq 保存退出重新编译翻译文件必做修改配置后必须重新编译.mo二进制翻译文件否则新配置不会生效pybabel compile -d /opt/module/miniconda3/envs/superset/lib/python3.8/site-packages/superset/translations成功标志输出中包含compiling catalog .../zh/LC_MESSAGES/messages.po to .../messages.mo过程中出现的 200 条 warnings 是正常的无需担心。重启 Superset 服务superset.sh start脚本内容如下#!/bin/bash superset_status(){ resultps -ef | awk /gunicorn/ !/awk/{print $2} | wc -l if [[ $result -eq 0 ]]; then return 0 else return 1 fi } superset_start(){ source ~/.bashrc superset_status /dev/null 21 if [[ $? -eq 0 ]]; then conda activate superset ; gunicorn --workers 5 --timeout 120 --bind hadoop101:8787 --daemon superset.app:create_app() else echo superset正在运行 fi } superset_stop(){ superset_status /dev/null 21 if [[ $? -eq 0 ]]; then echo superset未在运行 else ps -ef | awk /gunicorn/ !/awk/{print $2} | xargs kill -9 fi } case $1 in start ) echo 启动Superset superset_start ;; stop ) echo 停止Superset superset_stop ;; restart ) echo 重启Superset superset_stop superset_start ;; status ) superset_status /dev/null 21 if [[ $? -eq 0 ]]; then echo superset未在运行 else echo superset正在运行 fi esac汉化完成