Add comments explaining how translitcodec *is* used
This commit is contained in:
parent
c843de8a57
commit
cc81b5e55e
@ -15,6 +15,7 @@
|
|||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
import re
|
import re
|
||||||
|
# This import *is* used; see word.encode('tranlit/long') below.
|
||||||
import translitcodec
|
import translitcodec
|
||||||
|
|
||||||
|
|
||||||
@ -27,6 +28,7 @@ def slugify(text, delim=u'-'):
|
|||||||
"""
|
"""
|
||||||
result = []
|
result = []
|
||||||
for word in _punct_re.split(text.lower()):
|
for word in _punct_re.split(text.lower()):
|
||||||
|
# Uses translitcodec!
|
||||||
word = word.encode('translit/long')
|
word = word.encode('translit/long')
|
||||||
if word:
|
if word:
|
||||||
result.append(word)
|
result.append(word)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user