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
4384e57f
Commit
4384e57f
authored
Feb 18, 2015
by
Will Daly
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Force English for email opt in text appearing on the marketing site
parent
063c5c68
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
11 deletions
+15
-11
lms/djangoapps/courseware/tests/test_views.py
+6
-2
lms/djangoapps/courseware/views.py
+9
-9
No files found.
lms/djangoapps/courseware/tests/test_views.py
View file @
4384e57f
...
...
@@ -370,13 +370,17 @@ class ViewsTestCase(ModuleStoreTestCase):
# in the label escaped as expected.
self
.
_email_opt_in_checkbox
(
response
,
cgi
.
escape
(
self
.
org_html
))
@patch.dict
(
settings
.
FEATURES
,
{
'IS_EDX_DOMAIN'
:
True
})
@patch.dict
(
settings
.
FEATURES
,
{
'IS_EDX_DOMAIN'
:
True
,
'ENABLE_MKTG_EMAIL_OPT_IN'
:
True
})
def
test_mktg_about_language_edx_domain
(
self
):
# Since we're in an edx-controlled domain, and our marketing site
# supports only English, override the language setting
# and use English.
response
=
self
.
_load_mktg_about
(
language
=
'eo'
)
response
=
self
.
_load_mktg_about
(
language
=
'eo'
,
org
=
self
.
org_html
)
self
.
assertContains
(
response
,
"Enroll in"
)
self
.
assertContains
(
response
,
"and learn about its other programs"
)
@patch.dict
(
settings
.
FEATURES
,
{
'IS_EDX_DOMAIN'
:
False
})
def
test_mktg_about_language_openedx
(
self
):
...
...
lms/djangoapps/courseware/views.py
View file @
4384e57f
...
...
@@ -899,6 +899,15 @@ def mktg_course_about(request, course_id):
'course_modes'
:
course_modes
,
}
# The edx.org marketing site currently displays only in English.
# To avoid displaying a different language in the register / access button,
# we force the language to English.
# However, OpenEdX installations with a different marketing front-end
# may want to respect the language specified by the user or the site settings.
force_english
=
settings
.
FEATURES
.
get
(
'IS_EDX_DOMAIN'
,
False
)
if
force_english
:
translation
.
activate
(
'en-us'
)
if
settings
.
FEATURES
.
get
(
'ENABLE_MKTG_EMAIL_OPT_IN'
):
# Drupal will pass organization names using a GET parameter, as follows:
# ?org=Harvard
...
...
@@ -932,15 +941,6 @@ def mktg_course_about(request, course_id):
len
(
org_list
)
)
.
format
(
institution_series
=
org_name_string
)
# The edx.org marketing site currently displays only in English.
# To avoid displaying a different language in the register / access button,
# we force the language to English.
# However, OpenEdX installations with a different marketing front-end
# may want to respect the language specified by the user or the site settings.
force_english
=
settings
.
FEATURES
.
get
(
'IS_EDX_DOMAIN'
,
False
)
if
force_english
:
translation
.
activate
(
'en-us'
)
try
:
return
render_to_response
(
'courseware/mktg_course_about.html'
,
context
)
finally
:
...
...
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