Xqt has uploaded a new change for review.
https://gerrit.wikimedia.org/r/184120
Change subject: [bugfix] use message_package_name for i18n.twhas_key() method
......................................................................
[bugfix] use message_package_name for i18n.twhas_key() method
This patch re-enables using this method through Python Shell
Change-Id: I8e766f30dac4a13b6b215ddd7dc50a95386e730d
---
M pywikibot/i18n.py
1 file changed, 4 insertions(+), 2 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core
refs/changes/20/184120/1
diff --git a/pywikibot/i18n.py b/pywikibot/i18n.py
index 6b0dede..50cf790 100644
--- a/pywikibot/i18n.py
+++ b/pywikibot/i18n.py
@@ -359,7 +359,8 @@
@param parameters: For passing parameters.
"""
package = twtitle.split("-")[0]
- transdict = getattr(__import__(messages_package_name, fromlist=[package]),
package).msg
+ transdict = getattr(__import__(messages_package_name, fromlist=[package]),
+ package).msg
code_needed = False
# If a site is given instead of a code, use its language
@@ -490,7 +491,8 @@
@param twtitle: The TranslateWiki string title, in <package>-<key> format
"""
package = twtitle.split("-")[0]
- transdict = getattr(__import__("i18n", fromlist=[package]), package).msg
+ transdict = getattr(__import__(messages_package_name, fromlist=[package]),
+ package).msg
# If a site is given instead of a code, use its language
if hasattr(code, 'code'):
code = code.code
--
To view, visit https://gerrit.wikimedia.org/r/184120
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I8e766f30dac4a13b6b215ddd7dc50a95386e730d
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Xqt <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits