From ced2265ce25b188821eeae5d8eb6581d78c46f01 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 22 Apr 2014 08:41:50 +0530 Subject: [PATCH] Fix a bug that caused spell checking to fail when using the builtin spanish dictionary --- resources/dictionaries/es-ES/locales | 2 +- src/calibre/spell/import_from.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/resources/dictionaries/es-ES/locales b/resources/dictionaries/es-ES/locales index a11c9c0edd..91c4d4cbc9 100644 --- a/resources/dictionaries/es-ES/locales +++ b/resources/dictionaries/es-ES/locales @@ -1,3 +1,4 @@ +es-ES es-AR es-BO es-CL @@ -6,7 +7,6 @@ es-CR es-CU es-DO es-EC -es-ES es-GT es-HN es-MX diff --git a/src/calibre/spell/import_from.py b/src/calibre/spell/import_from.py index 39b81b6ef5..615bac39f4 100644 --- a/src/calibre/spell/import_from.py +++ b/src/calibre/spell/import_from.py @@ -62,6 +62,7 @@ def import_from_libreoffice_source_tree(source_path): df = os.path.join(dest, locale + os.path.splitext(src)[1]) shutil.copyfile(src, df) with open(os.path.join(dest, 'locales'), 'wb') as f: + locales.sort(key=lambda x: (0, x) if x == locale else (1, x)) f.write(('\n'.join(locales)).encode('utf-8')) if want_locales: