jenkins-bot has submitted this change and it was merged.
Change subject: Fix TranslationError when fallback=False
......................................................................
Fix TranslationError when fallback=False
When fallback is False, TranslationError may occur when the requested
language was not English. The TranslationError exception message
assumed the error could only occur when an English message is missing.
Change-Id: Iac76961dbf61d5221a4db3fb5e6e113499221e2a
---
M pywikibot/i18n.py
1 file changed, 4 insertions(+), 2 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/i18n.py b/pywikibot/i18n.py
index 4a7d5d0..ee2bb92 100644
--- a/pywikibot/i18n.py
+++ b/pywikibot/i18n.py
@@ -504,9 +504,11 @@
break
else:
raise TranslationError(
- 'No English translation has been defined for TranslateWiki key'
+ 'No %s translation has been defined for TranslateWiki key'
' %r\nIt can happen due to lack of i18n submodule or files. '
- 'Read
https://mediawiki.org/wiki/PWB/i18n' % twtitle)
+ 'Read
https://mediawiki.org/wiki/PWB/i18n'
+ % ('English' if 'en' in langs else "'%s'" %
lang,
+ twtitle))
# send the language code back via the given list
if code_needed:
code.append(alt)
--
To view, visit
https://gerrit.wikimedia.org/r/243622
To unsubscribe, visit
https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Iac76961dbf61d5221a4db3fb5e6e113499221e2a
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot <>