On 11/01/2016 1:25 PM,
dbori...@gmail.com wrote:
> Yes it is but it is not that i want =)
> Sorry for my poor english. May be you did not correctly understand my
> previous message.
> I want to convert any unicode symbols to english ascii symbols.
> slugify_unicode makes url with russian characters if page title is in
> russian. It is not that i want.
> And django's slugify simply strips non-ascii characters. It not that I
> want too.
> Is there any way to convert (transliterate) unicode to ascii on the fly
> without additional programming? Any config option or something like this?
I haven't seen one but I'm interested so I googled and found ...
http://stackoverflow.com/questions/816285/where-is-pythons-best-ascii-for-this-unicode-database
... which might let you get some of the transliteration done in your own
slugify() based on Django's slugify() in django/utils/text.py. You might
also need to maintain a list of unicode chars you don't like and replace
them with your preferred ascii chars before using slugify.
Good luck and please post your solution
Thanks
Mike
>
> понедельник, 11 Ñ Ð½Ð²Ð°Ñ€Ñ 2016 г., 1:48:31 UTC+3
> пользователь Stephen McDonald Ð½Ð°Ð¿Ð¸Ñ Ð°Ð»:
>
> The first dozen or so results in Google when searching for
> "slugify unicode" reveal exact what you want.
>
> On Mon, Jan 11, 2016 at 12:01 AM, <
dbori...@gmail.com <javascript:>>
> wrote:
>
> Hi guys,
>
> I have a site with russian locale and want to convert non-ascii
> slugs into ascii one to avoid ugly urlencoded urls.
> I've replaced Mezzanine's slugify with Django's
> default django.template.defaultfilters.slugify but it just
> strips non-ascii characters but i want to transliterate them.
> Is there any way to do it in Mezzanine without making own slugify?
>
> Thnx for any answer.
>
> --
> You received this message because you are subscribed to the
> Google Groups "Mezzanine Users" group.
> To unsubscribe from this group and stop receiving emails from
> it, send an email to
mezzanine-use...@googlegroups.com
> <javascript:>.
> <
https://groups.google.com/d/optout>.
> --
> You received this message because you are subscribed to the Google
> Groups "Mezzanine Users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to
mezzanine-use...@googlegroups.com
> <mailto:
mezzanine-use...@googlegroups.com>.