mirror of
https://github.com/Matysh/houseplan-card
synced 2026-07-31 08:28:31 +00:00
feat v1.11.0: full English translation + en/ru UI localization
- All card UI strings moved to src/i18n.ts (en/ru); language follows the HA profile automatically, new 'language: en|ru' card option forces it; GUI editor localized and got the language dropdown; generated device names localized via BuildCtx.loc. - English-only codebase: comments, docstrings, test names, backend error messages and logs. Russian remains only in the ru dictionary, ru.json, iconFor regexes matching Russian device names (+their fixtures) and README.ru.md. - Docs English-first: README (EN) + README.ru.md, ARCHITECTURE/DEVELOPMENT/ ROADMAP/CHANGELOG fully translated; translations/en.json had Russian - fixed. - Removed obsolete RELEASE_NOTES_v1.9.3.md and scripts_publish.sh.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
"""Юнит-тесты чистой валидации House Plan (загружаем validation.py по пути,
|
||||
без импорта пакета HA-интеграции)."""
|
||||
"""Unit tests for the pure House Plan validation (validation.py is loaded by path,
|
||||
without importing the HA integration package)."""
|
||||
import importlib.util
|
||||
import os
|
||||
|
||||
@@ -17,7 +17,7 @@ _spec.loader.exec_module(v)
|
||||
|
||||
def test_sanitize_marker_id():
|
||||
assert v.sanitize_marker_id("../etc/passwd") == "_etc_passwd"
|
||||
assert v.sanitize_marker_id("..") == "misc" # чистый traversal → misc
|
||||
assert v.sanitize_marker_id("..") == "misc" # pure traversal → misc
|
||||
assert v.sanitize_marker_id(".") == "misc"
|
||||
assert v.sanitize_marker_id("") == "misc"
|
||||
assert len(v.sanitize_marker_id("a" * 200)) == 64
|
||||
@@ -25,8 +25,8 @@ def test_sanitize_marker_id():
|
||||
|
||||
def test_sanitize_filename_strips_path():
|
||||
assert v.sanitize_filename("/a/b/c/manual.pdf") == "manual.pdf"
|
||||
assert v.sanitize_filename("..\\..\\evil.pdf") == "evil.pdf" # обратные слэши = путь
|
||||
assert v.sanitize_filename("...hidden.pdf") == "hidden.pdf" # ведущие точки убраны
|
||||
assert v.sanitize_filename("..\\..\\evil.pdf") == "evil.pdf" # backslashes = a path
|
||||
assert v.sanitize_filename("...hidden.pdf") == "hidden.pdf" # leading dots stripped
|
||||
|
||||
|
||||
def test_file_ext():
|
||||
@@ -79,9 +79,9 @@ def test_config_schema_defaults_and_extra():
|
||||
def test_config_schema_full_roundtrip():
|
||||
cfg = {
|
||||
"spaces": [{
|
||||
"id": "f1", "title": "1 этаж", "plan_url": "/p/f1.svg",
|
||||
"id": "f1", "title": "Floor 1", "plan_url": "/p/f1.svg",
|
||||
"aspect": 0.8, "view_box": [0, 0, 1, 1],
|
||||
"rooms": [{"id": "r1", "name": "Зал", "area": "hall",
|
||||
"rooms": [{"id": "r1", "name": "Hall", "area": "hall",
|
||||
"poly": [[0, 0], [0.5, 0], [0.5, 0.5], [0, 0.5]]}],
|
||||
"segments": [[0, 0, 0.5, 0]],
|
||||
}],
|
||||
|
||||
Reference in New Issue
Block a user