Closed andrew000 closed 3 months ago
bot
python -m aiogram_i18n extract -i '.\bot' -o '.\locales\test.ftl' -cm -k 'i18n' --locales 'uk'
age="42"
start()
hello-text = hello-text { $name } { $age }
hello-text = hello-text { $name }
import asyncio from aiogram import Dispatcher, Bot from aiogram.filters import Command from aiogram.fsm.storage.memory import MemoryStorage from aiogram.types import Message from aiogram_i18n import I18nContext dp = Dispatcher(storage=MemoryStorage()) @dp.message(Command("start")) async def start(msg: Message, i18n: I18nContext) -> None: await msg.reply(i18n.get("hello-text", name="Peter", age="42")) if __name__ == '__main__': bot = Bot(token="42") asyncio.run(dp.start_polling(bot))
aiogram==3.2.0 aiogram_i18n==1.3.3 libcst==1.1.0
Resolved in another lib
Foreword
bot
directorybot
directorySteps
python -m aiogram_i18n extract -i '.\bot' -o '.\locales\test.ftl' -cm -k 'i18n' --locales 'uk'
age="42"
from code instart()
functionExpected behavior
hello-text = hello-text { $name } { $age }
should be commented and new linehello-text = hello-text { $name }
should be added.Current behavior
hello-text = hello-text { $name } { $age }
has not changedCode to reproduce bug
Requiremets