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

svn: r16844
This commit is contained in:
Jérôme Rapinat 2011-03-17 16:31:57 +00:00
parent 1c8384ff20
commit d4c1d16f28

View File

@ -6870,6 +6870,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, menu_set, key): def get_first_letters(db, menu_set, key):