summaryrefslogtreecommitdiff
path: root/src/zope/i18n/negotiator.py
diff options
context:
space:
mode:
authorSylvain Viollon <thefunny@gmail.com>2018-10-19 08:36:22 +0200
committerGitHub <noreply@github.com>2018-10-19 08:36:22 +0200
commit6e699ade2b38f3ed387fa8765c486757014c76ad (patch)
tree272dbffda393b12839b3fb7088a4e65ef479cc9c /src/zope/i18n/negotiator.py
parenteaa6190adc828b157727f4be7ca7ef6a00f3d73c (diff)
parent6c9f3eaa735887c160c6d91916759ac950702479 (diff)
downloadzope-i18n-6e699ade2b38f3ed387fa8765c486757014c76ad.tar.gz
Merge pull request #34 from minddistrict/CB-556-FR-translation
Add support for pluralization
Diffstat (limited to 'src/zope/i18n/negotiator.py')
-rw-r--r--src/zope/i18n/negotiator.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/zope/i18n/negotiator.py b/src/zope/i18n/negotiator.py
index 66417c0..3c5fa17 100644
--- a/src/zope/i18n/negotiator.py
+++ b/src/zope/i18n/negotiator.py
@@ -14,16 +14,17 @@
"""Language Negotiator
"""
from zope.interface import implementer
-
from zope.i18n.interfaces import INegotiator
from zope.i18n.interfaces import IUserPreferredLanguages
+
def normalize_lang(lang):
lang = lang.strip().lower()
lang = lang.replace('_', '-')
lang = lang.replace(' ', '')
return lang
+
def normalize_langs(langs):
# Make a mapping from normalized->original so we keep can match
# the normalized lang and return the original string.
@@ -32,6 +33,7 @@ def normalize_langs(langs):
n_langs[normalize_lang(l)] = l
return n_langs
+
@implementer(INegotiator)
class Negotiator(object):