4423: Web report does not handle Czech 'CH' character properly (contribution by phejl)

svn: r16843
This commit is contained in:
Jérôme Rapinat 2011-03-17 16:29:59 +00:00
parent 36b418ec65
commit 8996d04cb9

View File

@ -6391,6 +6391,17 @@ def first_letter(string):
(lang_country, modifier ) = locale.getlocale() (lang_country, modifier ) = locale.getlocale()
if lang_country == "sv_SE" and (letter == u'W' or letter == u'V'): if lang_country == "sv_SE" and (letter == u'W' or letter == u'V'):
letter = u'V,W' letter = u'V,W'
# See : http://www.gramps-project.org/bugs/view.php?id = 4423
elif (lang_country == "cs_CZ" or lang_country == "sk_SK") and letter == u'C' and len(string) > 1:
second_letter = normalize('NFKC', unicode(string))[1].upper()
if second_letter == u'H':
letter += u'h'
elif lang_country == "sk_SK" and letter == u'D' and len(string) > 1:
second_letter = normalize('NFKC', unicode(string))[1].upper()
if second_letter == u'Z':
letter += u'z'
elif second_letter == u'Ž':
letter += u'ž'
return letter return letter
def get_first_letters(db, handle_list, key): def get_first_letters(db, handle_list, key):