1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 21:06:19 +00:00

Fix zh Hant/Hans (#91390)

* Fix zh Hant/Hans

* Fix comments
This commit is contained in:
Michael Hansen
2023-04-24 09:55:08 -05:00
committed by GitHub
parent 1ae7610622
commit 5075281add
2 changed files with 19 additions and 8 deletions

View File

@@ -95,31 +95,40 @@ def test_language_as_region() -> None:
def test_zh_hant() -> None:
"""Test that the zh-Hant defaults to HK."""
"""Test that the zh-Hant matches HK or TW first."""
assert language.matches(
"zh-Hant",
["en-US", "en-GB", "zh-CN", "zh-HK", "zh-TW"],
) == [
"zh-HK",
"zh-CN",
"zh-TW",
"zh-CN",
]
assert language.matches(
"zh-Hant",
["en-US", "en-GB", "zh-CN", "zh-TW", "zh-HK"],
) == [
"zh-TW",
"zh-HK",
"zh-CN",
]
def test_zh_hans() -> None:
"""Test that the zh-Hans defaults to TW."""
"""Test that the zh-Hans matches CN first."""
assert language.matches(
"zh-Hans",
["en-US", "en-GB", "zh-CN", "zh-HK", "zh-TW"],
) == [
"zh-TW",
"zh-CN",
"zh-HK",
"zh-TW",
]
def test_zh_no_code() -> None:
"""Test that the zh defaults to CN."""
"""Test that the zh defaults to CN first."""
assert language.matches(
"zh",
["en-US", "en-GB", "zh-CN", "zh-HK", "zh-TW"],