From c494c638f341d0defa47eedbcef7d8a05e65cee2 Mon Sep 17 00:00:00 2001 From: David MENTRE Date: Sat, 19 Dec 2009 19:37:32 +0100 Subject: [PATCH 3/5] Use the language option when changing locale for street sorting --- ocitysmap-render | 4 ++-- ocitysmap/street_index.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ocitysmap-render b/ocitysmap-render index 3aaf760..5761cf4 100755 --- a/ocitysmap-render +++ b/ocitysmap-render @@ -67,8 +67,8 @@ def main(): parser.add_option('-l', '--language', dest='language', metavar='LANGUAGE_CODE', help='Language to use when generating the index' - ' (default=fr_FR)', - default='fr_FR') + ' (default=fr_FR.UTF-8)', + default='fr_FR.UTF-8') (options, args) = parser.parse_args() if len(args): diff --git a/ocitysmap/street_index.py b/ocitysmap/street_index.py index 7eee822..0f859f5 100644 --- a/ocitysmap/street_index.py +++ b/ocitysmap/street_index.py @@ -471,7 +471,7 @@ class OCitySMap: # built to represent the list of squares, and the list is # alphabetically-sorted. prev_locale = locale.getlocale(locale.LC_COLLATE) - locale.setlocale(locale.LC_COLLATE, "fr_FR.UTF-8") + locale.setlocale(locale.LC_COLLATE, self.language) try: sl = sorted(map(_humanize_street_label, sl), lambda x, y: locale.strcoll(x[0].lower(), y[0].lower())) -- 1.6.3.3