{% block title %}{% endblock %}
-
+
{% block extrastyle %}{% endblock %}
{% block extrahead %}{% endblock %}
diff --git a/django/contrib/admin/templates/admin/login.html b/django/contrib/admin/templates/admin/login.html
index 5f338f703e9..dd39e95f117 100644
--- a/django/contrib/admin/templates/admin/login.html
+++ b/django/contrib/admin/templates/admin/login.html
@@ -1,7 +1,7 @@
{% extends "admin/base_site.html" %}
{% load i18n %}
-{% block stylesheet %}{% load adminmedia %}{% admin_media_prefix %}css/login.css{% endblock %}
+{% block stylesheet %}{% load adminmedia %}{% admin_media_prefix %}css/login{% if LANGUAGE_BIDI %}_rtl{% endif %}.css{% endblock %}
{% block bodyclass %}login{% endblock %}
{% block content_title %}{% endblock %}
{% block breadcrumbs %}{% endblock %}
diff --git a/django/core/context_processors.py b/django/core/context_processors.py
index 1ab07687760..cb08b12e5b7 100644
--- a/django/core/context_processors.py
+++ b/django/core/context_processors.py
@@ -36,6 +36,10 @@ def i18n(request):
context_extras['LANGUAGE_CODE'] = request.LANGUAGE_CODE
else:
context_extras['LANGUAGE_CODE'] = settings.LANGUAGE_CODE
+
+ from django.utils import translation
+ context_extras['LANGUAGE_BIDI'] = translation.get_language_bidi()
+
return context_extras
def request(request):
diff --git a/docs/i18n.txt b/docs/i18n.txt
index e6660f939dc..cd24ba0f931 100644
--- a/docs/i18n.txt
+++ b/docs/i18n.txt
@@ -230,12 +230,17 @@ Each ``RequestContext`` has access to two translation-specific variables:
language code and the second is the language name (in that language).
* ``LANGUAGE_CODE`` is the current user's preferred language, as a string.
Example: ``en-us``. (See "How language preference is discovered", below.)
+ * ``LANGUAGE_BIDI`` is the current language's direction. If True, it's a
+ right-to-left language, e.g: Hebrew, Arabic. If False it's a
+ left-to-right language, e.g: English, French, German etc.
+
If you don't use the ``RequestContext`` extension, you can get those values with
-two tags::
+three tags::
{% get_current_language as LANGUAGE_CODE %}
{% get_available_languages as LANGUAGES %}
+ {% get_current_language_bidi as LANGUAGE_BIDI %}
These tags also require a ``{% load i18n %}``.