1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-07-19 04:58:11 +00:00
trezor-firmware/core/mocks/generated/trezortranslate.pyi
matejcik 721bb2ad81 WIP
2024-01-24 21:15:00 +01:00

67 lines
1.7 KiB
Python

from typing import *
from trezortranslate_keys import TR # noqa: F401
"""Translation object with attributes."""
MAX_HEADER_LEN: int
"""Maximum length of the translations header."""
# rust/src/translations/obj.rs
def area_bytesize() -> int:
"""Maximum size of the translation blob that can be stored."""
# rust/src/translations/obj.rs
def get_language() -> str:
"""Get the current language."""
# rust/src/translations/obj.rs
def init() -> None:
"""Initialize the translations system.
Loads and verifies translation data from flash. If the verification passes,
Trezor UI is translated from that point forward.
"""
# rust/src/translations/obj.rs
def deinit() -> None:
"""Deinitialize the translations system.
Translations must be deinitialized before erasing or writing to flash.
"""
# rust/src/translations/obj.rs
def erase() -> None:
"""Erase the translations blob from flash."""
# rust/src/translations/obj.rs
def write(data: bytes, offset: int) -> None:
"""Write data to the translations blob in flash."""
# rust/src/translations/obj.rs
def verify(data: bytes) -> None:
"""Verify the translations blob."""
# rust/src/translations/obj.rs
class TranslationsHeader:
"""Metadata about the translations blob."""
language: str
version: tuple[int, int, int, int]
change_language_title: str
change_language_prompt: str
data_len: int
data_hash: bytes
total_len: int
def __init__(self, header_bytes: bytes) -> None:
"""Parse header from bytes.
The header has variable length.
"""
@staticmethod
def load_from_flash() -> TranslationsHeader | None:
"""Load translations from flash."""