Localize appliance course labels
This commit is contained in:
1 parent
71f2101d11
commit
d24c94e303
3 files changed
+86
-40
No files matched your search
@@ -166,6 +166,52 @@ def test_confirmed_dishwasher_course_names():
|
||||
}
|
||||
|
||||
|
||||
def test_confirmed_course_names_are_localized():
|
||||
washer_codes = (
|
||||
'69', '6a', '6b', '6c', '6d', '6e', '6f', '70', '71',
|
||||
'72', '73', '74', '75', '76', '77', '78', '79', '88',
|
||||
)
|
||||
dishwasher_codes = ('82', '8a', 'a7', 'a8', '8c', '88')
|
||||
expected = {
|
||||
'cs': {
|
||||
'washer': (
|
||||
'AI praní', 'Vlna', 'Džíny', 'Halenky', 'Jemné prádlo',
|
||||
'Sportovní oblečení', 'Ložní prádlo', 'Ručníky',
|
||||
'Rychlé praní', 'Košile', 'Dezinfekce', 'Čištění bubnu',
|
||||
'Outdoor', 'Dětské potřeby', 'Bavlna',
|
||||
'Máchání + odstřeďování', 'Pouze odstřeďování',
|
||||
'Péče o domácí mazlíčky',
|
||||
),
|
||||
'dishwasher': (
|
||||
'Automatický', 'Normální', 'Intenzivní', 'Expresní',
|
||||
'Extra tichý', 'Samočištění',
|
||||
),
|
||||
},
|
||||
'nl': {
|
||||
'washer': (
|
||||
'AI Wash', 'Wol', 'Spijkergoed', 'Blouses', 'Fijne was',
|
||||
'Sportkleding', 'Beddengoed', 'Handdoeken', 'Snelle was',
|
||||
'Overhemden', 'Hygiëne', 'Trommel reinigen', 'Outdoor',
|
||||
'Babyverzorging', 'Katoen', 'Spoelen + centrifugeren',
|
||||
'Alleen centrifugeren', 'Pet Care',
|
||||
),
|
||||
'dishwasher': (
|
||||
'Auto', 'Normaal', 'Intensief', 'Express', 'Extra stil',
|
||||
'Zelfreiniging',
|
||||
),
|
||||
},
|
||||
}
|
||||
|
||||
for language, translations in expected.items():
|
||||
catalog = _load(language)['entity']['select']
|
||||
washer = catalog['washer_cycle_table_02']['state']
|
||||
dishwasher = catalog['dishwasher_cycle']['state']
|
||||
assert tuple(washer[code] for code in washer_codes) == translations['washer']
|
||||
assert tuple(dishwasher[code] for code in dishwasher_codes) == (
|
||||
translations['dishwasher']
|
||||
)
|
||||
|
||||
|
||||
# The hood fan is its device's primary feature: fan.py sets _attr_name = None
|
||||
# so it presents as the device itself, and never reads a catalog name. Same
|
||||
# for the ARTIK051 air-purifier's airflow_fan (issue #56) -- ordered speed
|
||||
|
||||
Reference in new issue
Block a user