aiogram / i18n

31 stars 2 forks source link

[BUG] "Extract" does not comment keys whose arguments have been changed (or removed) #32

Closed andrew000 closed 3 months ago

andrew000 commented 11 months ago

Foreword

Steps

  1. python -m aiogram_i18n extract -i '.\bot' -o '.\locales\test.ftl' -cm -k 'i18n' --locales 'uk'
  2. Remove age="42" from code in start() function
  3. Re-run command from step 1

Expected behavior

Current behavior

Code to reproduce bug

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))

Requiremets

aiogram==3.2.0
aiogram_i18n==1.3.3
libcst==1.1.0
andrew000 commented 3 months ago

Resolved in another lib