On 16/03/2018 12:40 AM, Peter of the Norse wrote:
I ran into a similar problem with one of my projects; people were
using Greek and Cyrillic letters and other symbols to be cute. It’s
all in English, but they kept doing things like using ß for B and ¥
for Y. And then expecting to be able to search the way they way it
looks. So I am doing the cleanup in the .save() method. My only
advice is to use
https://docs.python.org/3/library/stdtypes.html?highlight=translate#str.translate instead
of multiple replaces. If you make the translation map a global
variable, it is much faster.
Wow!
Thank you. Ain't Python marvellous!
Mike
- Peter of the Norse
On Feb 15, 2018, at 5:55 AM, Mike Dewhirst <mi...@dewhirst.com.au
<mailto:mi...@dewhirst.com.au>> wrote:
On 15/02/2018 10:19 PM, Hanne Moa wrote:
On 2018-02-06 12:51, Mike Dewhirst wrote:
Thank you. I think this is where we probably need to go. I asked
the original question because I'm hoping the project will reach a
tipping point and start to accumulate a growing number of
multilingual users. We have our first multinational user but they
only operate in the English speaking world so no pressure at the
moment.
There can be no sort that satisfies every possible language at the
same time. For instance, Norwegian sorts "ä" as "a" and "ö" as "o".
Swedish sorts them after "å" as separate letters: åäö. Then there is
Turkish where "i" sorts differently from "ı" (dotless i).
That is interesting! It says to me that longer term I need to think
about special sort orders for different languages. A bit above my pay
grade just now.
I've worked the greek letter prefixes by using a separate sort field
only seen by the software. A simple replace('α', 'a') lets me adjust
sort order for the moment. That may work with diacritics for some
time. I'll be driven by actual requirements until I hit a brick wall
and then I'll ask for PhD help :)
Thanks
Mike
I'm guessing chemistry names follow their own rules, you could see
how hard it is to make your own os collation table and use that?
Then everything running on the server would sort by the same rules.
HM
--
You received this message because you are subscribed to the Google
Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it,
send an email to django-users+unsubscr...@googlegroups.com
<mailto:django-users+unsubscr...@googlegroups.com>.
To post to this group, send email to django-users@googlegroups.com
<mailto:django-users@googlegroups.com>.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/bfd1633b-a651-fec9-6f2a-86efac8d2e8c%40dewhirst.com.au.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google
Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to django-users+unsubscr...@googlegroups.com
<mailto:django-users+unsubscr...@googlegroups.com>.
To post to this group, send email to django-users@googlegroups.com
<mailto:django-users@googlegroups.com>.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/65B863CA-7C6C-4DC7-83FC-DAE87D2F6E8C%40Radio1190.org
<https://groups.google.com/d/msgid/django-users/65B863CA-7C6C-4DC7-83FC-DAE87D2F6E8C%40Radio1190.org?utm_medium=email&utm_source=footer>.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Django
users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/8296b698-9681-093b-ea81-52675583f1cb%40dewhirst.com.au.
For more options, visit https://groups.google.com/d/optout.