Add network description to translation files (#2660)

This commit is contained in:
Joakim Sørensen 2021-03-02 15:41:00 +01:00 committed by GitHub
parent 455e80b07c
commit d50fd3b580
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 2 deletions

View File

@ -332,7 +332,10 @@ SCHEMA_TRANSLATION_CONFIGURATION = vol.Schema(
SCHEMA_ADDON_TRANSLATIONS = vol.Schema(
{vol.Optional(ATTR_CONFIGURATION): {str: SCHEMA_TRANSLATION_CONFIGURATION}},
{
vol.Optional(ATTR_CONFIGURATION): {str: SCHEMA_TRANSLATION_CONFIGURATION},
vol.Optional(ATTR_NETWORK): {str: str},
},
extra=vol.REMOVE_EXTRA,
)

View File

@ -21,7 +21,10 @@ def test_loading_traslations(coresys: CoreSys, tmp_path):
for file in ("no.yaml", "de.yaml"):
write_json_or_yaml_file(
tmp_path / "translations" / file,
{"configuration": {"test": {"name": "test", "test": "test"}}},
{
"configuration": {"test": {"name": "test", "test": "test"}},
"network": {"80/tcp": "Webserver port"},
},
)
translations = coresys.store.data._read_addon_translations(tmp_path)
@ -32,3 +35,5 @@ def test_loading_traslations(coresys: CoreSys, tmp_path):
assert translations["de"]["configuration"]["test"]["name"] == "test"
assert "test" not in translations["en"]["configuration"]["test"]
assert translations["no"]["network"]["80/tcp"] == "Webserver port"