Catalogs: Fix issue with catalog generation using Hungarian UI and author_sort beginning with multiple letter groups. Fixes #1091581 (creating a catalog in Hungarian)

This commit is contained in:
Kovid Goyal 2013-01-05 23:12:35 +05:30
commit 81af3cd695

View File

@ -663,9 +663,9 @@ class CatalogBuilder(object):
# Hack to force the cataloged leading letter to be
# an unadorned character if the accented version sorts before the unaccented
exceptions = {
u'Ä': u'A',
u'Ö': u'O',
u'Ü': u'U'
u'Ä': u'A',
u'Ö': u'O',
u'Ü': u'U'
}
if key is not None:
@ -3473,7 +3473,7 @@ class CatalogBuilder(object):
self.play_order += 1
navLabelTag = Tag(ncx_soup, 'navLabel')
textTag = Tag(ncx_soup, 'text')
if len(authors_by_letter[1]) > 1:
if authors_by_letter[1] == self.SYMBOLS:
fmt_string = _(u"Authors beginning with %s")
else:
fmt_string = _(u"Authors beginning with '%s'")
@ -4425,9 +4425,11 @@ class CatalogBuilder(object):
c (unicode): character
Return:
(str): legal XHTML anchor string of unicode charactar name
(str): legal XHTML anchor string of unicode character name
"""
fullname = unicodedata.name(unicode(c))
fullname = ''
for cc in c:
fullname += unicodedata.name(unicode(cc))
terms = fullname.split()
return "_".join(terms)