﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
4821	Add hyphenation option to djago.utils.text.wrap and a default filter hyphenatedwordwrap	django@…	nobody	"Ned Batchelder recently released an implementation of [http://www.nedbatchelder.com/code/modules/hyphenate.html Frank Liang's hyphenation algorithm for python] into the public domain.
This patch includes this file as django.utils.hyphenate and adds an optional argument keyword argument 'hyphenate' to django.utils.text.wrap to do the obvious. It defaults to False. A new default filter is added hyphenatedwordwrap which does the obvious as well.

There are internationalization issues which still need to be worked out, documentation and a unit test to be added as well.
I may not be able to work on the internationalization part so I am posting the patch as I have it working now.

{{{
#!python shell
>>> from django.utils.text import *
>>> wrap(""this is a test of the word wrap system with hyphenation"", 10)
u'this is a\ntest of\nthe word\nwrap\nsystem\nwith\nhyphenation'
>>> wrap(""this is a test of the word wrap system with hyphenation"", 10, True)
u'this is a\ntest of\nthe word\nwrap sys-\ntem with hy-\nphenation'
>>> wrap(""this is a test of the word wrap\nsystem with hyphenation"", 10, True)
u'this is a\ntest of\nthe word\nwrap\nsystem\nwith hy-\nphenation'
>>>
}}}
"		closed	Template system	dev		wontfix	hyphenate wordwrap		Design decision needed	1	1	1	1	0	0
