{"id":21164534,"url":"https://github.com/barabum0/aiogram-translation","last_synced_at":"2026-03-13T10:33:01.438Z","repository":{"id":168044611,"uuid":"643617374","full_name":"barabum0/aiogram-translation","owner":"barabum0","description":"Simple aiogram translation addon built over pydantic!","archived":false,"fork":false,"pushed_at":"2023-12-12T17:49:25.000Z","size":56,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-22T01:28:10.852Z","etag":null,"topics":["addon","aiogram","pydantic","python","telegram","translation"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/aiogram-translation/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/barabum0.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-05-21T18:19:28.000Z","updated_at":"2024-12-03T08:51:57.000Z","dependencies_parsed_at":null,"dependency_job_id":"5a3da6c0-7ea5-4714-80c3-63f6663d9a88","html_url":"https://github.com/barabum0/aiogram-translation","commit_stats":null,"previous_names":["barabum0/aiogram-translation"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/barabum0/aiogram-translation","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/barabum0%2Faiogram-translation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/barabum0%2Faiogram-translation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/barabum0%2Faiogram-translation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/barabum0%2Faiogram-translation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/barabum0","download_url":"https://codeload.github.com/barabum0/aiogram-translation/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/barabum0%2Faiogram-translation/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30465432,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-13T06:34:02.089Z","status":"ssl_error","status_checked_at":"2026-03-13T06:33:49.182Z","response_time":60,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["addon","aiogram","pydantic","python","telegram","translation"],"created_at":"2024-11-20T14:06:27.068Z","updated_at":"2026-03-13T10:33:01.430Z","avatar_url":"https://github.com/barabum0.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n# Aiogram Translation Plugin 🌐\n\n[![Supported Python versions](https://img.shields.io/pypi/pyversions/aiogram-translation.svg?logo=python\u0026logoColor=FFE873)](https://pypi.org/project/aiogram-translation)\n[![PyPI version](https://img.shields.io/pypi/v/aiogram-translation.svg?logo=pypi\u0026logoColor=FFE873)](https://pypi.org/project/aiogram-translation)\n[![PyPI downloads](https://img.shields.io/pypi/dm/aiogram-translation.svg)](https://pypi.org/project/aiogram-translation)\n[![wakatime](https://wakatime.com/badge/github/barabum0/aiogram-translation.svg)](https://wakatime.com/badge/github/barabum0/aiogram-translation)\n\n\u003c/div\u003e\n\n## About 📘\n\nThe Aiogram Translation Plugin is a convenient and powerful tool for integrating multilingual support into Aiogram-based Telegram bots. It enables seamless translation and language handling, making your bot accessible to a wider, global audience.\n\n## Installation 📥\n\n```shell\npython -m pip install -U aiogram-translation \n```\n\n## Usage 🛠️\n\nTo use the Aiogram Translation Plugin in your bot, import the necessary classes from `aiogram_translation`. Set up your languages, default language, and register the translator with your dispatcher. Here's a basic example:\n\n`main.py` \n```python\nfrom aiogram import Dispatcher, Bot, F\nfrom aiogram.types import Message, InlineKeyboardMarkup, InlineKeyboardButton, CallbackQuery\n\nfrom aiogram_translation import Translator\nfrom translations import *\n\nfrom os import getenv\n\nbot = Bot(getenv(\"TELEGRAM_TOKEN\"))\ndispatcher = Dispatcher()\ntranslator = Translator()\n\ntranslator.include([\n    English(),\n    Russian(),\n    Ukrainian()\n])\ntranslator.set_default('ru')\ntranslator.register(dispatcher)\n\n\n@dispatcher.message()\nasync def on_message(message: Message, language: BaseTranslation):\n    kb = InlineKeyboardMarkup(resize_keyboard=True, inline_keyboard=[[InlineKeyboardButton(text=language.start_button,\n                                                                                           callback_data=\"hoooray\")]])\n    await message.reply(language.start_message, reply_markup=kb)\n\n\n@dispatcher.callback_query(F.data == \"hoooray\")\nasync def on_hooray(query: CallbackQuery, language: BaseTranslation):\n    await query.answer(language.start_button_alert, show_alert=True)\n\n\ndispatcher.run_polling(bot)\n```\n\n`translations.py`\n```python\nfrom aiogram_translation.models import BaseTranslationBuilder\n\n\nclass BaseTranslation(BaseTranslationBuilder):\n    start_message: str\n    start_button: str\n    start_button_alert: str\n\n    link_lang_message: str\n\n\nclass English(BaseTranslation):\n    key = \"en\"\n    name = \"English\"\n\n    start_message = \"👋 Hi, I'm bot!\"\n    start_button = \"❤️ Click me!\"\n    start_button_alert = \"🎉 Hooray!\"\n\n\nclass Russian(BaseTranslation):\n    key = \"ru\"\n    name = \"Русский (Russian)\"\n\n    start_message = \"👋 Привет, я бот\"\n    start_button = \"❤️ Нажми на меня\"\n    start_button_alert = \"🎉 Ура!\"\n\n\nclass Ukrainian(BaseTranslation):\n    key = \"uk\"\n    name = \"Український (Ukrainian)\"\n\n    start_message = \"👋 Привіт, я бот\"\n    start_button = \"❤️ Натисни на мене\"\n    start_button_alert = \"🎉 Ура!\"\n```\n\n\n## Troubleshooting 🚨\n\nIf you encounter issues or have queries, feel free to check our [Issues section](https://github.com/barabum0/aiogram-translation/issues) on GitHub.\n\n## Contribution 🤝\n\nContributions are welcome. Please fork the repository, make your changes, and submit a pull request.\n\n## License 📜\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbarabum0%2Faiogram-translation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbarabum0%2Faiogram-translation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbarabum0%2Faiogram-translation/lists"}