Skip to content

feat(translations): add Simplified Chinese (zh-Hans) - #58

Merged
seevee merged 5 commits into
seevee:mainfrom
MF-142:main
Jul 30, 2026
Merged

feat(translations): add Simplified Chinese (zh-Hans)#58
seevee merged 5 commits into
seevee:mainfrom
MF-142:main

Conversation

@MF-142

@MF-142 MF-142 commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

add Simplified Chinese language

Summary

Added Simplified Chinese (zh-Hans) translation for the CAP Alerts integration to improve accessibility for Chinese-speaking users.

Changes

Added custom_components/cap_alerts/translations/zh-Hans.json

Test Plan

  • pytest tests -q passes
  • ruff check custom_components/ tests/ scripts/ passes
  • ruff format --diff custom_components/ tests/ scripts/ is clean
  • mypy custom_components/cap_alerts passes
  • Loaded in a running Home Assistant instance (for behavior changes)
  • Dependency order respected (model → providers → coordinator → sensor → config_flow → init)

@seevee seevee changed the title add Simplified Chinese language feat(translations): add Simplified Chinese (zh-Hans) Jul 30, 2026
@seevee

seevee commented Jul 30, 2026

Copy link
Copy Markdown
Owner

Thanks for this, merging shortly.

Checked before merge:

  • Key structure matches strings.json and translations/en.json exactly. No missing or extra keys in either direction.
  • No untranslated leftovers (no values identical to the English source).
  • UTF-8, LF, trailing newline, 2-space indent matching en.json.
  • Hassfest, Lint, Test, Type check all green.

I spot-checked the strings that carry real information and they're accurate: the September 2026 legacy-host retirement in feed_source, the "fails loud if the country does not publish geometry" warning on the GPS-polygon steps, and the NEW/CON/CAN entity-recreation caveat on wmo_source.

Some non-blocking notes for a later PR if you want them:

  • "feed" is translated two ways: 警报源 in the feed_source label, 馈送 in its own description and in streaming. Both show up in the same form.
  • 追踪器 vs 跟踪器 for "tracker". HA core's zh-Hans uses 设备跟踪器 for device_tracker. Your call.
  • zone_id is Zone ID(s) in English and the plural hint is dropped, though the description does say comma-separated.

Housekeeping:

  • I'm squash-merging, so the intermediate commits collapse into one. eccc.py on your head commit is byte-identical to main, so the delete/recreate in the history isn't reverting anything.
  • I'll extend tests/test_translation_keys_in_sync.py to cover all of translations/*.json in a follow-up. It only guards en.json right now, so this file could drift as new config-flow steps land.

再次感谢你的贡献!

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.

2 participants