mò
säÅEc           @   s'   d  Z  d k l Z d k Td „  Z d S(   sâ   
This code is based on code found in satchmo, in turn
based on samples found here -
http://www.b-list.org/weblog/2006/06/14/django-tips-template-context-processors

It is used to add some common variables to all the templates
(   s   translation(   t   *c         C   s-  d k  l } t | i ƒ } t |  ƒ } y t |  i	 d ƒ } Wn t j
 o d  } n X|  i d  } y t |  i	 d ƒ } Wn t j
 o d  } n Xt |  i ƒ d | i j o
 t } n t } h  d | <d | i <d | <d	 | i <d
 |  i <d | <d | <d | i d  <d | <S(   N(   s   settingst
   other_langi   t	   otro_langi   t	   site_baset	   site_roott	   site_namet	   media_urlt   url_patht   gui_langt	   base_lang(   t   django.conft   settingst   _t	   SITE_NAMER   t   i18n_site_baset   requestR   t   strt   sessionR   t   KeyErrort   Nonet   LANGUAGE_CODER   R   t   i18n_lang_suffixt   patht   LANGUAGES_BIDIt   Truet   content_bidit   Falset	   SITE_BASEt	   MEDIA_URL(   R   R   R   R   R   R   R   R   (    (    t@   /home/raph/garden/ghestalt/../ghestalt/app/context_processors.pyR      s     
N(   t   __doc__t   django.utilst   translationt   ghestalt.i18n.utilsR   (   R    R   (    (    R   t   ?   s   