mirror of
https://github.com/home-assistant/core.git
synced 2025-08-01 11:45:09 +02:00
Rename translations dir for integrations (#34494)
This commit is contained in:
@@ -41,7 +41,7 @@ def find_core():
|
||||
if not strings.is_file():
|
||||
continue
|
||||
|
||||
translations = int_dir / ".translations" / "en.json"
|
||||
translations = int_dir / "translations" / "en.json"
|
||||
|
||||
strings_json = json.loads(strings.read_text())
|
||||
translations_json = json.loads(translations.read_text())
|
||||
|
@@ -39,7 +39,7 @@ def run_download_docker():
|
||||
"json",
|
||||
"--unzip_to",
|
||||
"/opt/dest",
|
||||
],
|
||||
]
|
||||
)
|
||||
print()
|
||||
|
||||
@@ -78,12 +78,9 @@ def get_component_path(lang, component):
|
||||
"""Get the component translation path."""
|
||||
if os.path.isdir(os.path.join("homeassistant", "components", component)):
|
||||
return os.path.join(
|
||||
"homeassistant", "components", component, ".translations", f"{lang}.json"
|
||||
)
|
||||
else:
|
||||
return os.path.join(
|
||||
"homeassistant", "components", ".translations", f"{component}.{lang}.json"
|
||||
"homeassistant", "components", component, "translations", f"{lang}.json"
|
||||
)
|
||||
raise ExitApp(f"Integration {component} not found under homeassistant/components/")
|
||||
|
||||
|
||||
def get_platform_path(lang, component, platform):
|
||||
@@ -94,7 +91,7 @@ def get_platform_path(lang, component, platform):
|
||||
"components",
|
||||
component,
|
||||
platform,
|
||||
".translations",
|
||||
"translations",
|
||||
f"{lang}.json",
|
||||
)
|
||||
else:
|
||||
@@ -102,7 +99,7 @@ def get_platform_path(lang, component, platform):
|
||||
"homeassistant",
|
||||
"components",
|
||||
component,
|
||||
".translations",
|
||||
"translations",
|
||||
f"{platform}.{lang}.json",
|
||||
)
|
||||
|
||||
|
Reference in New Issue
Block a user