Django

Code

Changeset 3091

Show
Ignore:
Timestamp:
06/06/06 10:22:53 (2 years ago)
Author:
hugo
Message:

fixed #2089: added language bidirectional support and updated the admin to use it. thanks meir@mksoft!

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/django/contrib/admin/templates/admin/base.html

    r3079 r3091  
    33<head> 
    44<title>{% block title %}{% endblock %}</title> 
    5 <link rel="stylesheet" type="text/css" href="{% block stylesheet %}{% load adminmedia %}{% admin_media_prefix %}css/base.css{% endblock %}" /> 
     5<link rel="stylesheet" type="text/css" href="{% block stylesheet %}{% load adminmedia %}{% admin_media_prefix %}css/base{% if LANGUAGE_BIDI %}_rtl{% endif %}.css{% endblock %}" /> 
    66{% block extrastyle %}{% endblock %} 
    77{% block extrahead %}{% endblock %} 
  • django/trunk/django/contrib/admin/templates/admin/login.html

    r2809 r3091  
    22{% load i18n %} 
    33 
    4 {% block stylesheet %}{% load adminmedia %}{% admin_media_prefix %}css/login.css{% endblock %} 
     4{% block stylesheet %}{% load adminmedia %}{% admin_media_prefix %}css/login{% if LANGUAGE_BIDI %}_rtl{% endif %}.css{% endblock %} 
    55{% block bodyclass %}login{% endblock %} 
    66{% block content_title %}{% endblock %} 
  • django/trunk/django/core/context_processors.py

    r2809 r3091  
    3737    else: 
    3838        context_extras['LANGUAGE_CODE'] = settings.LANGUAGE_CODE 
     39     
     40    from django.utils import translation 
     41    context_extras['LANGUAGE_BIDI'] = translation.get_language_bidi() 
     42 
    3943    return context_extras 
    4044 
  • django/trunk/docs/i18n.txt

    r2927 r3091  
    231231    * ``LANGUAGE_CODE`` is the current user's preferred language, as a string. 
    232232      Example: ``en-us``. (See "How language preference is discovered", below.) 
     233    * ``LANGUAGE_BIDI`` is the current language's direction. If True, it's a 
     234      right-to-left language, e.g: Hebrew, Arabic. If False it's a 
     235      left-to-right language, e.g: English, French, German etc. 
     236 
    233237 
    234238If you don't use the ``RequestContext`` extension, you can get those values with 
    235 two tags:: 
     239three tags:: 
    236240 
    237241    {% get_current_language as LANGUAGE_CODE %} 
    238242    {% get_available_languages as LANGUAGES %} 
     243    {% get_current_language_bidi as LANGUAGE_BIDI %} 
    239244 
    240245These tags also require a ``{% load i18n %}``.