From 0df89ea9b70db8f5a3d712fcbf5dacc7a24f270a Mon Sep 17 00:00:00 2001 From: Serge Noiraud Date: Fri, 1 May 2009 08:39:17 +0000 Subject: [PATCH] Narrativeweb : Swedish specific alphabet sort. svn: r12500 --- src/plugins/webreport/NarrativeWeb.py | 65 +++++++++++++++++++++++---- 1 file changed, 56 insertions(+), 9 deletions(-) diff --git a/src/plugins/webreport/NarrativeWeb.py b/src/plugins/webreport/NarrativeWeb.py index 9caeb79b4..db5a45dec 100644 --- a/src/plugins/webreport/NarrativeWeb.py +++ b/src/plugins/webreport/NarrativeWeb.py @@ -295,6 +295,19 @@ class BasePage: sorted_set = {} + # The comment below from the glibc locale sv_SE in + # localedata/locales/sv_SE : + # + # % The letter w is normally not present in the Swedish alphabet. It + # % exists in some names in Swedish and foreign words, but is accounted + # % for as a variant of 'v'. Words and names with 'w' are in Swedish + # % ordered alphabetically among the words and names with 'v'. If two + # % words or names are only to be distinguished by 'v' or % 'w', 'v' is + # % placed before 'w'. + # + # See : http://www.gramps-project.org/bugs/view.php?id=2933 + # + (lang_country, modifier ) = locale.getlocale() for ltr in get_first_letters(db, handle_list, key): try: sorted_set[ltr] += 1 @@ -314,9 +327,14 @@ class BasePage: of.write('\t\t\n') of.write('\t\n') else: @@ -329,9 +347,14 @@ class BasePage: while (cols <= 26 and index < num_ltrs): letter = sorted_first_letter[index] title_str = _('Surnames') if key == 0 else _('Places') - title_str += _(' starting with %s') % letter - of.write('\t\t\t
  • %s
  • \n' - % (letter, title_str, letter)) + if lang_country == "sv_SE" and ltr == u'V': + title_str += _(' starting with %s') % "V,W" + of.write('\t\t\t
  • %s
  • \n' + % ("V,W", title_str, "V,W")) + else: + title_str += _(' starting with %s') % letter + of.write('\t\t\t
  • %s
  • \n' + % (letter, title_str, letter)) cols += 1 index += 1 of.write('\t\t