Update documentation and code snippets

This commit is contained in:
2025-12-03 14:30:33 +03:00
parent 2a0ec209c3
commit 52139e5405
14 changed files with 484 additions and 200 deletions
+20 -12
View File
@@ -3,7 +3,6 @@
# This file is distributed under the same license as the Argenta package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2025.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: Argenta \n"
@@ -21,7 +20,7 @@ msgstr ""
#: ../../root/api/bridge.rst:4
msgid "DataBridge"
msgstr ""
msgstr "DataBridge"
#: ../../root/api/bridge.rst:6
msgid ""
@@ -29,66 +28,75 @@ msgid ""
"данных, которое существует в рамках одной сессии приложения (от запуска "
"до выхода). Она предназначена для обмена данными между обработчиками."
msgstr ""
"``DataBridge`` is an entity that provides temporary data storage that exists within "
"a single application session (from startup to exit). It is designed for data "
"exchange between handlers."
#: ../../root/api/bridge.rst:8
msgid "Основной способ получения доступа к ``DataBridge`` — через ``di``."
msgstr ""
msgstr "The main way to access ``DataBridge`` is through ``di``."
#: ../../root/api/bridge.rst:21
msgid "**Практический пример: Аутентификация**"
msgstr ""
msgstr "**Practical Example: Authentication**"
#: ../../root/api/bridge.rst:23
msgid ""
"Рассмотрим пример, где команда `login` сохраняет токен аутентификации, а "
"команда `get-profile` использует его."
msgstr ""
"Let's consider an example where the `login` command saves an authentication token, "
"and the `get-profile` command uses it."
#: ../../root/api/bridge.rst:29
msgid "**Как это работает:**"
msgstr ""
msgstr "**How it works:**"
#: ../../root/api/bridge.rst:31
msgid ""
"При вызове обработчика ``dishka`` автоматически внедряет экземпляр "
"``DataBridge``."
msgstr ""
msgstr "When calling a handler, ``dishka`` automatically injects a ``DataBridge`` instance."
#: ../../root/api/bridge.rst:32
msgid ""
"Команда ``login --username <имя>`` вызывает ``login_handler``, который "
"через внедрённый ``data_bridge`` сохраняет токен."
msgstr ""
"The ``login --username <name>`` command calls ``login_handler``, which saves the "
"token through the injected ``data_bridge``."
#: ../../root/api/bridge.rst:33
msgid ""
"Команда ``get-profile`` вызывает ``get_profile_handler``, который так же "
"получает ``data_bridge`` и извлекает из него токен."
msgstr ""
"The ``get-profile`` command calls ``get_profile_handler``, which also receives "
"``data_bridge`` and extracts the token from it."
#: ../../root/api/bridge.rst:42
msgid ""
"Инициализирует хранилище. При использовании через ``di`` вызывается "
"автоматически."
msgstr ""
msgstr "Initializes the storage. When used through ``di``, it is called automatically."
#: ../../root/api/bridge.rst:46
msgid "Обновляет хранилище данными из словаря."
msgstr ""
msgstr "Updates the storage with data from a dictionary."
#: ../../root/api/bridge.rst:50
msgid "Возвращает все данные из хранилища."
msgstr ""
msgstr "Returns all data from the storage."
#: ../../root/api/bridge.rst:54
msgid "Возвращает значение по ключу или ``None``, если ключ не найден."
msgstr ""
msgstr "Returns the value by key or ``None`` if the key is not found."
#: ../../root/api/bridge.rst:58
msgid "Удаляет значение по ключу. Вызывает ``KeyError``, если ключ не найден."
msgstr ""
msgstr "Deletes the value by key. Raises ``KeyError`` if the key is not found."
#: ../../root/api/bridge.rst:62
msgid "Полностью очищает хранилище."
msgstr ""
msgstr "Completely clears the storage."