Patches item #3614066, was opened at 2013-05-28 16:05
Message generated for change (Tracker Item Submitted) made by nobody
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=603140&aid=3614066&group_id=93107

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: rewrite
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Nobody/Anonymous (nobody)
Summary: important fix for i18n.py

Initial Comment:
the "i18n.py" file in the "/pywikibot" directory has a useful "translate" 
function; but it doesn't work well with multiple "{{PLURAL}}" directives in the 
same string: for example, the following code:
pywikibot.i18n.translate('en',{'en':'%(links)d {{PLURAL:%(links)d|link|links}} 
and %(apples)d {{PLURAL:%(apples)d|apple|apples}}'},{'links':1,'apples':4})
returns "1 link and 4 link" instead of "1 link and 4 apples".
I've fixed that doing a "while" loop for each {{PLURAL}} and 
replacing/translating only one of them at a time; probably other functions need 
such fixes as well.
My version is attached, feel free to improve it and include it in the 
pywikipediabot rewrite branch.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=603140&aid=3614066&group_id=93107

_______________________________________________
Pywikipedia-bugs mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/pywikipedia-bugs

Reply via email to