Hello Eduardo,

Yes, you are right, Wikipedia works fine with accents in the slugs. But it 
gets a little "dirty" because, for example, in browser address bar, I can 
read

https://pt.wikipedia.org/wiki/Wikipédia:Página_principal    (notice that 
the "e" on Wikipedia and the first "a" on Pagina have accents)

but when copied and pasted here it becames:

https://pt.wikipedia.org/wiki/Wikip%C3%A9dia:P%C3%A1gina_principal

I think it somehow makes it more difficult to the user, because the 
uniqueness of the address is gone. There are have two forms of it. Of 
course, both works, but they are two. So I choose to use the default Django 
slugify function, following your advice.

I believe this should be the *default solution* to be used in Mezzanine, at 
least for every latin derived language, or every language that uses roman 
characters.

Russian and Chinese use other alphabets, so it makes sense using the 
original letters on the slug (and slugify_unicode). But on latin derived 
languages, removing the accents makes thinks simpler (in my opinion).

For anyone reading this latter, to use the default Django slugify I have 
created a *defaults.py *file inside myapp/myapp with this content:

from __future__ import unicode_literals
from django.conf import settings
from django.utils.translation import ugettext_lazy as _
from mezzanine.conf import register_setting

register_setting(
    name="SLUGIFY",
    description=_("Dotted Python path to the callable for converting "
        "strings into URL slugs. Defaults to "
        "``mezzanine.utils.urls.slugify_unicode`` which allows for 
non-ascii "
        "URLs. Change to ``django.template.defaultfilters.slugify`` to use "
        "Django's slugify function, or something of your own if required."),
    editable=False,
    default="django.template.defaultfilters.slugify",
)

Obrigado / Gracias / Thank you

Greetings,
Márcio



Em quarta-feira, 6 de janeiro de 2016 13:52:50 UTC-2, Eduardo Rivas 
escreveu:
>
> You can choose your own function for generating slugs by customizing 
> settings:SLUGIFY. Docs: 
> http://mezzanine.jupo.org/docs/configuration.html#slugify 
>
> For what it's worth, sites as big as Wikipedia use accented characters 
> (and even parentheses) in their slugs. There's nothing special about 
> that, they just need to be encoded properly (which Django and Mezzanine 
> can do). 
> https://pt.wikipedia.org/wiki/Wikip%C3%A9dia:P%C3%A1gina_principal 
>

-- 
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-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to