Steps to replicate the issue (include links if applicable):
>>> import pywikibot
>>> from pywikibot import i18n
>>> i18n.twtranslate('en', 'unknown_package', fallback_prompt='foo')
>>> i18n.twtranslate('en', 'unknown_package', fallback_prompt='foo')What happens?:
For 'en'
Traceback (most recent call last):
File "<pyshell#12>", line 1, in <module>
i18n.twtranslate('en', 'unknown_package', fallback_prompt='foo')
File "D:\pwb\GIT\core\pywikibot\i18n.py", line 749, in twtranslate
raise pywikibot.exceptions.TranslationError(fill(
pywikibot.exceptions.TranslationError: No English translation has been defined for TranslateWiki key
"unknown_package". It can happen due to lack of i18n submodule or
files or an outdated submodule. See
https://www.mediawiki.org/wiki/Manual:Pywikibot/i18nFor 'es':
Traceback (most recent call last):
File "<pyshell#13>", line 1, in <module>
i18n.twtranslate('es', 'unknown_package', fallback_prompt='foo')
File "D:\pwb\GIT\core\pywikibot\i18n.py", line 749, in twtranslate
raise pywikibot.exceptions.TranslationError(fill(
pywikibot.exceptions.TranslationError: No English translation has been defined for TranslateWiki key
"unknown_package". It can happen due to lack of i18n submodule or
files or an outdated submodule. See
https://www.mediawiki.org/wiki/Manual:Pywikibot/i18nWhat should have happened instead?:
The fallback_prompt should be returned:
'foo'
Software version (skip for WMF-hosted wikis like Wikipedia):
Pywikibot < 8 if i18n files are updated after 26th September 2022; maybe also Pywikibot 8 if i18n files are older than 28th December 2021.
Other:
See also https://translatewiki.net/wiki/Thread:Support/Pywikibot:Cosmetic_changes-append/en