[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Maposmatic-dev] [PATCH] Bug fix: Consider " œ" an "o" letter in French
From: |
David MENTRE |
Subject: |
[Maposmatic-dev] [PATCH] Bug fix: Consider " œ" an "o" letter in French |
Date: |
Sat, 21 Apr 2012 18:53:08 +0200 |
While we are fixing this, also consider "æ" an "a" letter and "ÿ" a "y"
letter.
Source: https://fr.wikipedia.org/wiki/Alphabet_fran%C3%A7ais
Signed-off-by: David MENTRE <address@hidden>
---
ocitysmap2/i18n.py | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/ocitysmap2/i18n.py b/ocitysmap2/i18n.py
index 94c85d6..cd8fba7 100644
--- a/ocitysmap2/i18n.py
+++ b/ocitysmap2/i18n.py
@@ -115,9 +115,10 @@ class i18n_fr_generic(i18n):
# for IndexPageGenerator.upper_unaccent_string
E_ACCENT = re.compile(ur"[éèêëẽ]", re.IGNORECASE | re.UNICODE)
I_ACCENT = re.compile(ur"[íìîïĩ]", re.IGNORECASE | re.UNICODE)
- A_ACCENT = re.compile(ur"[áàâäã]", re.IGNORECASE | re.UNICODE)
- O_ACCENT = re.compile(ur"[óòôöõ]", re.IGNORECASE | re.UNICODE)
+ A_ACCENT = re.compile(ur"[áàâäãæ]", re.IGNORECASE | re.UNICODE)
+ O_ACCENT = re.compile(ur"[óòôöõœ]", re.IGNORECASE | re.UNICODE)
U_ACCENT = re.compile(ur"[úùûüũ]", re.IGNORECASE | re.UNICODE)
+ Y_ACCENT = re.compile(ur"[ÿ]", re.IGNORECASE | re.UNICODE)
def __init__(self, language, locale_path):
self.language = str(language)
@@ -129,6 +130,7 @@ class i18n_fr_generic(i18n):
s = self.A_ACCENT.sub("a", s)
s = self.O_ACCENT.sub("o", s)
s = self.U_ACCENT.sub("u", s)
+ s = self.Y_ACCENT.sub("y", s)
return s.upper()
def language_code(self):
--
1.7.5.4
- [Maposmatic-dev] [PATCH] Bug fix: Consider " œ" an "o" letter in French,
David MENTRE <=