fix: add missing translations and fix translation loading/testing

This commit is contained in:
sebthom
2025-05-13 19:27:43 +02:00
parent 21d7cc557d
commit 1f9895850f
3 changed files with 46 additions and 16 deletions

View File

@@ -109,6 +109,8 @@ def translate(text:object, caller:inspect.FrameInfo | None) -> str:
file_basename = os.path.splitext(os.path.basename(caller.filename))[0]
if module_name and module_name.endswith(f".{file_basename}"):
module_name = module_name[:-(len(file_basename) + 1)]
if module_name:
module_name = module_name.replace(".", "/")
file_key = f"{file_basename}.py" if module_name == file_basename else f"{module_name}/{file_basename}.py"
translation = dicts.safe_get(_TRANSLATIONS,
file_key,