← Back to team overview

team4alfanous team mailing list archive

[Branch ~team4alfanous/alfanous/alfanous-git] Rev 527: keep only the first 2 letters of the request language

 

------------------------------------------------------------
revno: 527
committer: Assem Chelli <assem.ch@xxxxxxxxx>
timestamp: Mon 2013-01-07 21:47:14 +0100
message:
  keep only the first 2 letters of the request language
  
  example:
  - en_GB becomes en
  - ar_DZ becomes ar
modified:
  src/alfanous-django/wui/views.py


--
lp:alfanous
https://code.launchpad.net/~team4alfanous/alfanous/alfanous-git

Your team Alfanous team is subscribed to branch lp:alfanous.
To unsubscribe from this branch go to https://code.launchpad.net/~team4alfanous/alfanous/alfanous-git/+edit-subscription
=== modified file 'src/alfanous-django/wui/views.py'
--- src/alfanous-django/wui/views.py	2013-01-07 19:27:14 +0000
+++ src/alfanous-django/wui/views.py	2013-01-07 20:47:14 +0000
@@ -89,7 +89,7 @@
 
     # language information
     current_language = translation.get_language()
-    request_language = translation.get_language_from_request( request )
+    request_language = translation.get_language_from_request( request )[:2]
     available_languages = settings.LANGUAGES
     try:
         translation.activate( language )