Created
January 5, 2018 23:20
-
-
Save mathjazz/f9f097aad0e24bfed3764ae987f1ac2d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/pontoon/base/context_processors.py b/pontoon/base/context_processors.py | |
index 7eb31dc..a974c21 100644 | |
--- a/pontoon/base/context_processors.py | |
+++ b/pontoon/base/context_processors.py | |
@@ -1,4 +1,11 @@ | |
from django.conf import settings | |
+from django.utils import translation | |
+ | |
+ | |
+def i18n(request): | |
+ return { | |
+ 'DIR': 'rtl' if translation.get_language_bidi() else 'ltr' | |
+ } | |
def globals(request): | |
diff --git a/pontoon/settings/base.py b/pontoon/settings/base.py | |
index 7905f7e..a2ee940 100644 | |
--- a/pontoon/settings/base.py | |
+++ b/pontoon/settings/base.py | |
@@ -167,6 +167,7 @@ CONTEXT_PROCESSORS = ( | |
'session_csrf.context_processor', | |
'django.contrib.messages.context_processors.messages', | |
'pontoon.base.context_processors.globals', | |
+ 'pontoon.base.context_processors.i18n', | |
) | |
TEMPLATES = [ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment