Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added known locales list. Added LANG and DIR to the context.
- Loading branch information
Fred Wenzel
committed
Jan 6, 2011
1 parent
c286693
commit 4be0ae8
Showing
5 changed files
with
32 additions
and
10 deletions.
There are no files selected for viewing
Empty file.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
from django.conf import settings | ||
from django.utils import translation | ||
|
||
|
||
def i18n(request): | ||
return {'LANGUAGES': settings.LANGUAGES, | ||
'LANG': settings.LANGUAGE_URL_MAP.get(translation.get_language()) | ||
or translation.get_language(), | ||
'DIR': 'rtl' if translation.get_language_bidi() else 'ltr', | ||
} |
Empty file.
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
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