diff sat_website/utils.py @ 41:1a0f24401866

send adhesion form results via email to the admins and the new member
author souliane <souliane@mailoo.org>
date Tue, 03 Feb 2015 15:15:59 +0100
parents dfe7139dae0a
children 746e53efc188
line wrap: on
line diff
--- a/sat_website/utils.py	Tue Feb 03 15:14:42 2015 +0100
+++ b/sat_website/utils.py	Tue Feb 03 15:15:59 2015 +0100
@@ -22,6 +22,7 @@
 
 from os.path import basename, realpath, join
 from django.conf import settings
+from django.utils import translation
 from collections import OrderedDict
 
 
@@ -78,3 +79,10 @@
 def get_asso_subscr_amounts():
     """Returns the subscription amounts as defined in the Rules of the association."""
     return settings.ASSO_SUBSCR_AMOUNTS
+
+def get_language_name_local(language):
+    """Returns the localised language name.
+    
+    @param language (str): language code (e.g. 'fr' or 'en')
+    """
+    return translation.get_language_info(language)['name_local']