{"id":41443825,"url":"https://github.com/lutinglt/superset-zh","last_synced_at":"2026-01-23T14:59:44.258Z","repository":{"id":264180335,"uuid":"892564323","full_name":"lutinglt/superset-zh","owner":"lutinglt","description":"Superset 汉化, Superset 中文版","archived":false,"fork":false,"pushed_at":"2025-07-15T13:11:09.000Z","size":415,"stargazers_count":58,"open_issues_count":0,"forks_count":16,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-07-16T05:47:57.511Z","etag":null,"topics":["apache-superset","bi","data-analytics","superset"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lutinglt.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-11-22T10:58:30.000Z","updated_at":"2025-07-15T13:07:05.000Z","dependencies_parsed_at":null,"dependency_job_id":"13f2417a-152f-43a7-8480-770ab25b45ed","html_url":"https://github.com/lutinglt/superset-zh","commit_stats":null,"previous_names":["lutinglt/superset-zh"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/lutinglt/superset-zh","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lutinglt%2Fsuperset-zh","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lutinglt%2Fsuperset-zh/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lutinglt%2Fsuperset-zh/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lutinglt%2Fsuperset-zh/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lutinglt","download_url":"https://codeload.github.com/lutinglt/superset-zh/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lutinglt%2Fsuperset-zh/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28694460,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-23T14:15:13.573Z","status":"ssl_error","status_checked_at":"2026-01-23T14:09:05.534Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["apache-superset","bi","data-analytics","superset"],"created_at":"2026-01-23T14:59:44.095Z","updated_at":"2026-01-23T14:59:44.226Z","avatar_url":"https://github.com/lutinglt.png","language":"Python","readme":"# Superset 汉化/中文版\n\n![Version](https://img.shields.io/docker/v/lutinglt/superset-zh/latest?arch=amd64\u0026sort=semver\u0026color=066da5) ![Docker Pulls](https://img.shields.io/docker/pulls/lutinglt/superset-zh.svg?style=flat\u0026label=pulls\u0026logo=docker) ![Docker Size](https://img.shields.io/docker/image-size/lutinglt/superset-zh/latest?color=066da5\u0026label=size) ![License](https://img.shields.io/github/license/lutinglt/superset-zh)\n\n## 简介\n\n[PR: 29476](https://github.com/apache/superset/pull/29476) 这个提交中删除了大量的中文翻译，导致 Superset 的中文翻译质量大幅下降, 在这次提交后便没有人再对中文翻译进行维护。\n\n本项目基于 [PR: 27922](https://github.com/apache/superset/pull/27922) 的最后一次中文翻译提交，为了方便维护翻译, 用 Python 构建了翻译脚本, 改变了汉化步骤, 先生成 messages.json, 再通过 json 生成 messages.po 和 messages.mo, 此过程修复了一些翻译文件无法正常生效的问题.\n\n## 部署\n\n### Docker 镜像\n\n#### 开箱即用\n\n基于官方镜像生成, 修复了汉化问题, 仅保留中文和英文两种语言并且默认显示中文, 默认时区上海, 并添加了 PostgreSQL 和 MySQL 数据库驱动.\n为了做到开箱即用, 修改了以下默认配置 (不推荐生产使用):\n\n```python\nSECRET_KEY = 'superset'\nWTF_CSRF_ENABLED = False\nTALISMAN_ENABLED = False\n```\n\n一键启动体验汉化版 Superset, (http://localhost:8080)\n\n```bash\ndocker run -d --name superset -p 8080:8088 lutinglt/superset-zh\n```\n\n登录仍需执行以下命令 (命令创建一个管理员账户, 用户名密码均为 `admin`)\n\n```bash\ndocker exec -it superset superset fab create-admin \\\n              --username admin \\\n              --firstname 'admin' \\\n              --lastname 'admin' \\\n              --email admin@superset.apache.org \\\n              --password 'admin'\ndocker exec -it superset superset db upgrade\ndocker exec -it superset superset init\n```\n\n#### 自定义配置\n\n参考配置 docker-compose.yml\n\n```yml\nservices:\n  superset:\n    image: lutinglt/superset-zh\n    container_name: superset\n    hostname: superset\n    restart: always\n    ports:\n      - 8080:8088\n    volumes:\n    # sqlite 存储持久化\n      - ./superset:~/.superset\n    # 导入配置文件\n      - ./superset_config.py:/app/pythonpath/superset_config.py\n```\n\n参考配置 superset_config.py (PostgreSQL 数据库)\n\n\u003e [!NOTE]\n\u003e\n\u003e superset_config.py 会覆盖 config.py 里的配置, 优先级更高.\n\u003e\n\u003e SECRET_KEY 会用来签名 cookie 和加密 Superset 存储在数据库中的敏感数据\n\u003e\n\u003e 推荐使用 `openssl rand -base64 42` 命令生成一个足够复杂的安全密钥\n\n```python\nSECRET_KEY = 'superset'\nSQLALCHEMY_DATABASE_URI = 'postgresql://username:password@postgres/database'\n```\n\n#### 手动构建\n\n```bash\ngit clone https://github.com/lutinglt/superset-zh.git\ncd superset-zh\ndocker build -t lutinglt/superset-zh .\n```\n\n\u003e [!TIP]\n\u003e\n\u003e 4.1.1 有两个 Python 版本, 官方默认的基于 3.10, 无明显 BUG 的情况下本仓库将仅更新最新的稳定版镜像, 可以根据需要替换 Dockerfile 中 FROM 关键字后的基础镜像.\n\u003e\n\u003e 推荐使用最新的 Python 版本, 以提高性能和安全性, 但可能存在一些未知的 BUG, 请自行测试.\n\n### 手动汉化\n\n找到 Superset 安装目录下的 `translations` 目录, 找到 `zh/LC_MESSAGES` 目录\n\n下载最新版本的 `messages.json` 和 `messages.mo` 文件复制到 `zh/LC_MESSAGES` 目录下\n\n重启 Superset 查看汉化效果.\n\n\u003e [!IMPORTANT]\n\u003e\n\u003e config.py 里的 `LANGUAGES` 变量为空会关闭语言选择框, 默认为空, 参考配置:\n\u003e\n\u003e```python\n\u003eLANGUAGES = {\n\u003e    \"zh\": {\"flag\": \"cn\", \"name\": \"简体中文\"},\n\u003e    \"en\": {\"flag\": \"us\", \"name\": \"English\"},\n\u003e}\n\u003e```\n\n\u003e [!NOTE]\n\u003e\n\u003e superset_config.py 会覆盖 config.py 里的配置, 优先级更高.\n\n\u003e [!TIP]\n\u003e\n\u003e config.py 里的 `BABEL_DEFAULT_LOCALE` 变量可能会影响标题栏的汉化, 默认为 `en`, 如果标题栏没有汉化修改为 `zh` 下载最新的 `messages.po` 到 `zh/LC_MESSAGES` 目录下重新编译即可.\n\u003e\n\u003e```python\n\u003e# 替换成自己的安装目录下的 translations 目录\n\u003e# 编译报错请无视\n\u003epybabel compile -d superset/translations\n\u003e```\n\n\u003e [!TIP]\n\u003e\n\u003e 官方镜像 Superset 2.1.0 之后安装的默认安全选项更为严格, 部署后登录不上, 或无法启动推荐添加以下配置(汉化版默认添加了这些配置):\n\u003e\n\u003e ```python\n\u003e SECRET_KEY = 'superset' # 安全密钥, 启动必须进行配置\n\u003e WTF_CSRF_ENABLED = False # 关闭 CSRF 验证\n\u003e TALISMAN_ENABLED = False  # 关闭 TALISMAN 安全选项\n\u003e CONTENT_SECURITY_POLICY_WARNING = False  # 关闭内容安全策略警告\n\u003e ```\n\n## 脚本\n\n\u003e [!IMPORTANT]\n\u003e\n\u003e 脚本基于 Python 3.12 构建, 其中使用了一些类型注解可能会影响兼容性, 如有报错请自行删除, Python \u003e= 3.8 理论上都可以直接运行, 安装依赖运行命令:\n\u003e\n\u003e```bash\n\u003epip install -r requirements.txt\n\u003e```\n\n脚本主要改变了汉化步骤, json 更有利于定位和修改翻译内容, 脚本另一个功能是筛选出没有翻译的部分, 直接补充即可, 不需要手动浏览或者使用一些翻译软件进行翻译.(例如: poedit)\n\n### `generate_locales.py`\n\n基于 Superset 项目下的 `superset/translations/messages.pot` 和 `superset/translations/zh/LC_MESSAGES/messages.po` 生成最新的需要翻译的内容, 然后取本项目下 `messages.json` 已翻译的部分, 覆盖需要翻译的内容, 生成全部翻译条目(包含未翻译)和筛选出未翻译的条目的 json 文件, 进行手动校验翻译过程, 方便补充新翻译和修改已翻译内容, 具体查看脚本中的文档注释内容.\n\n### `generate_messages.py`\n\n根据已经翻译的内容生成 Superset 前端需要的 `messages.json` 和 `messages.mo`, 具体查看脚本中的文档注释内容.\n\n\u003e [!NOTE]\n\u003e\n\u003e 如果只是少量的纠正和补充(可以直接定位的), 只修改 `messages.json` 文件即可\n\u003e\n\u003e 然后运行 `generate_locales.py` 和 `generate_messages.py` 生成 `messages.mo` 文件, 供自己立即查看效果\n\n## 贡献\n\n欢迎提交 PR, 修复汉化问题, 补充汉化内容或者优化翻译脚本.\n\n汉化贡献仅需提交最新的 `messages.json` 文件即可.","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flutinglt%2Fsuperset-zh","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flutinglt%2Fsuperset-zh","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flutinglt%2Fsuperset-zh/lists"}