Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
aaedc154
Commit
aaedc154
authored
Oct 08, 2014
by
Omar Al-Ithawi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Edraak language switcher
parent
c92f52e0
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
35 additions
and
0 deletions
+35
-0
lms/djangoapps/edraak/__init__.py
+3
-0
lms/djangoapps/edraak/urls.py
+20
-0
lms/djangoapps/edraak/views.py
+7
-0
lms/envs/common.py
+3
-0
lms/urls.py
+2
-0
No files found.
lms/djangoapps/edraak/__init__.py
0 → 100644
View file @
aaedc154
"""
Edraak.org specific modules.
"""
lms/djangoapps/edraak/urls.py
0 → 100644
View file @
aaedc154
from
django.conf
import
settings
from
django.conf.urls
import
patterns
,
url
from
django.core.urlresolvers
import
LocaleRegexURLResolver
def
i18n_patterns
(
prefix
,
*
args
):
"""
Adds the language code prefix to every URL pattern within this
function. This may only be used in the root URLconf, not in an included
URLconf.
"""
pattern_list
=
patterns
(
prefix
,
*
args
)
if
not
settings
.
USE_I18N
:
return
pattern_list
return
[
LocaleRegexURLResolver
(
pattern_list
)]
urlpatterns
=
patterns
(
''
,
url
(
r'^setlang/$'
,
'edraak.views.set_language'
,
name
=
'edraak_setlang'
),
)
lms/djangoapps/edraak/views.py
0 → 100644
View file @
aaedc154
from
django.views.i18n
import
set_language
as
django_set_language
from
django.views.decorators.csrf
import
csrf_exempt
@csrf_exempt
def
set_language
(
request
):
return
django_set_language
(
request
)
\ No newline at end of file
lms/envs/common.py
View file @
aaedc154
...
@@ -1476,6 +1476,9 @@ INSTALLED_APPS = (
...
@@ -1476,6 +1476,9 @@ INSTALLED_APPS = (
# edX Mobile API
# edX Mobile API
'mobile_api'
,
'mobile_api'
,
# Edraak specific modules
'edraak'
,
)
)
######################### MARKETING SITE ###############################
######################### MARKETING SITE ###############################
...
...
lms/urls.py
View file @
aaedc154
...
@@ -68,6 +68,8 @@ urlpatterns = ('', # nopep8
...
@@ -68,6 +68,8 @@ urlpatterns = ('', # nopep8
url
(
r'^i18n/'
,
include
(
'django.conf.urls.i18n'
)),
url
(
r'^i18n/'
,
include
(
'django.conf.urls.i18n'
)),
url
(
r'^edraak/'
,
include
(
'edraak.urls'
)),
url
(
r'^embargo$'
,
'student.views.embargo'
,
name
=
"embargo"
),
url
(
r'^embargo$'
,
'student.views.embargo'
,
name
=
"embargo"
),
# Feedback Form endpoint
# Feedback Form endpoint
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment