Coverage for src / ezqt_app / domain / ports / translation_service.py: 100.00%
2 statements
« prev ^ index » next coverage.py v7.13.5, created at 2026-04-06 13:12 +0000
« prev ^ index » next coverage.py v7.13.5, created at 2026-04-06 13:12 +0000
1# ///////////////////////////////////////////////////////////////
2# DOMAIN.PORTS.TRANSLATION_SERVICE - Translation service port
3# Project: ezqt_app
4# ///////////////////////////////////////////////////////////////
6"""Protocol definitions for translation services."""
8from __future__ import annotations
10# ///////////////////////////////////////////////////////////////
11# IMPORTS
12# ///////////////////////////////////////////////////////////////
13# Standard library imports
14from typing import Protocol
17# ///////////////////////////////////////////////////////////////
18# PROTOCOLS
19# ///////////////////////////////////////////////////////////////
20class TranslationServiceProtocol(Protocol):
21 """Technical contract for translation services."""
23 def change_language(self, language_name: str) -> bool:
24 """Switch application language using its display name."""
26 def change_language_by_code(self, language_code: str) -> bool:
27 """Switch application language using its language code."""
29 def get_available_languages(self) -> list[str]:
30 """Return available language codes."""
32 def get_current_language_name(self) -> str:
33 """Return the current language display name."""
35 def get_current_language_code(self) -> str:
36 """Return the current language code."""
38 def translate(self, text: str) -> str:
39 """Translate a text using the active language context."""