Skip to content

i18n: add Chinese (Simplified) translation and fix POTFILES / 添加简体中文翻译并修复 POTFILES - #259

Open
xianyvyy wants to merge 1 commit into
jeffshee:masterfrom
xianyvyy:i18n-zh_CN
Open

i18n: add Chinese (Simplified) translation and fix POTFILES / 添加简体中文翻译并修复 POTFILES#259
xianyvyy wants to merge 1 commit into
jeffshee:masterfrom
xianyvyy:i18n-zh_CN

Conversation

@xianyvyy

Copy link
Copy Markdown

🇨🇳 中文说明

改动内容

  • 修复 po/POTFILES:原文件引用了不存在的路径 (src/window.ui, src/main.py, src/window.py),已更新为当前源码结构
  • 添加 zh_CN localepo/LINGUAS 加入 zh_CN
  • 新增 po/zh_CN.po:56 条完整中文翻译,覆盖全部界面:
    • 系统托盘菜单(显示/静音/播放暂停/重新加载/手气不错/退出)
    • 主窗口全部标签页(本地视频、在线串流、网页)
    • 设置面板(快捷开关、音量控制)
    • 关于对话框
    • 错误/提示对话框
  • src/menu.py + src/gui/control.py:将用户可见字符串包裹 _() gettext 标记,并添加 fallback 机制

翻译原则

  • 保持技术术语准确(如 "Streaming" → "在线串流")
  • 保留原版 emoji 和 HTML 标记
  • 遵循 GNOME 中文翻译惯例

验证

  • polib 验证 .po 文件 56 条全部通过
  • Flatpak 安装注入测试,LANG=zh_CN.UTF-8 启动正常

🇬🇧 English

Changes

  • Fix po/POTFILES: Updated stale paths to match current source structure
  • Add zh_CN locale: Register in po/LINGUAS
  • New po/zh_CN.po: 56 complete Chinese translations covering all UI surfaces
  • src/menu.py + src/gui/control.py: Wrapped user-visible strings with _() gettext markers, with safe fallback

Notes

  • Follows GNOME i18n conventions — language auto-follows system locale
  • gettext.install() already called in src/hidamari.in, so _() is available at runtime
  • Fallback identity function ensures no crash if _() is not yet installed during import

- Fix po/POTFILES to reference actual source paths (control.ui, __main__.py, menu.py, gui/control.py)
- Add zh_CN locale to po/LINGUAS
- Add Chinese (Simplified) translation with 56 strings covering all UI surfaces
- Wrap user-facing strings with _() gettext markers in src/menu.py and src/gui/control.py
- Add gettext fallback for environments where _() is not yet installed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant