generate_statistics() should just return a string

Bug #446803 reported by Jonas Häggqvist
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Yardbird
Confirmed
Low
Space Hobo

Bug Description

Having to return a formatting string and matching tuple seems fairly useless for generate_statistics(). Just expect a string and let the generate_statistics() deal with how to come up with it.

The only possible upside I can come up with is a slightly higher chance that numbers will be properly formatted according to l10n.

Revision history for this message
Space Hobo (spacehobo) wrote :

The l10n question is one that I've kind of avoided for now. I'm not convinced that it really applies in this instance, because the app author can always _() the format string before returning it anyway. If anything, the l10n of the apps is the app maintainers' responsibility, and core yardbird shouldn't have po files for (say) the clickolinko app.

The current architecture was a half-considered thing. The other direction we could take it is to have the format string replaced with a template to render and the stats represented as a dictionary. Then one could customize/localize the text at the template level (which is where most of this sort of skinning happens anyway).

Changed in yardbird:
importance: Undecided → Low
assignee: nobody → Space Hobo (spacehobo)
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.