44from aiogram .types import CallbackQuery , Message
55
66from bot .callbacks .callback import SaveCallbackFactory
7+ from bot .i18n .lexicon import Lexicon
78from bot .keyboards .keyboards import Keyboards
89from bot .services .bot_service import BotService
910from bot .states .bot_state import BotState
@@ -15,11 +16,14 @@ def __init__(self, bot: Bot, kb: Keyboards, bot_service: BotService):
1516 self .kb = kb
1617 self .bot_service = bot_service
1718
18- async def start_command (self , message : Message ):
19- await message .answer (text = 'Hi user! This start message.' , reply_markup = self .kb .get_start_button ())
19+ async def start_command (self , message : Message , lexicon : Lexicon , user_lang : str | None ):
20+ await message .answer (
21+ text = lexicon .get_text ('Hi user! This start message.' , user_lang ),
22+ reply_markup = self .kb .get_start_button (),
23+ )
2024
21- async def help_command (self , message : Message ):
22- await message .answer (text = 'This help message.' )
25+ async def help_command (self , message : Message , lexicon : Lexicon , user_lang : str | None ):
26+ await message .answer (text = lexicon . get_text ( 'This help message.' , user_lang ) )
2327
2428 async def answer (self , message : Message , answer : str ):
2529 await self .__send_message (message .chat .id , answer , message .message_id )
@@ -39,9 +43,12 @@ async def answer_fsm_state_2(self, message: Message, state: FSMContext):
3943 await message .answer (f"Step 1: { data ['step_1' ]} \n Step 2: { data ['step_2' ]} " )
4044 await state .clear ()
4145
42- async def answer_inline_button (self , message : Message ):
46+ async def answer_inline_button (self , message : Message , lexicon : Lexicon ):
4347 callback = SaveCallbackFactory (message_id = message .message_id ).pack ()
44- await message .answer (text = 'This help message' , reply_markup = self .kb .get_inline_button (callback_data = callback ))
48+ await message .answer (
49+ text = lexicon .get_text ('Inline button message' ),
50+ reply_markup = self .kb .get_inline_button (callback_data = callback ),
51+ )
4552
4653 async def reply (self , message : Message ):
4754 await message .reply (text = self .bot_service .upper (message .text ))
0 commit comments