i18n messages are placed in scripts folder as submodule. They are not available with the pypi package and can fail therefore. There are those places with i18n usage in the pywkibot framework:
https://codesearch.wmcloud.org/pywikibot/?q=(pywikibot%7Ccosmetic_changes)-&i=nope&files=pywikibot&excludeFiles=&repos=
- bot.py: fallback can be used for input statement
- fixes.py: replace.py script is required to use fixes which is not available with pypi package
- page.touch(): usually this method does not write and the summary could be hardcoded but i18n was introduced due to T199042
- page.save(): appends cosmetic_changes message if enabled
- pagegenerators.py: fallback messages are used here
See https://lists.wikimedia.org/pipermail/pywikibot/2021-February/010073.html