Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
edx-platform-release
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hsin-Yu Chien
edx-platform-release
Commits
4026e2f8
Unverified
Commit
4026e2f8
authored
5 years ago
by
Zainab Amir
Committed by
GitHub
5 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #20233 from edx/zamir/LEARNER_1338_add_button_for_lang_choice
Add language selection button in footer
parents
e00dbe64
ab7fef23
Loading
Loading
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lms/static/sass/shared/_footer.scss
+13
-0
13 additions, 0 deletions
lms/static/sass/shared/_footer.scss
lms/templates/widgets/footer-language-selector.html
+24
-16
24 additions, 16 deletions
lms/templates/widgets/footer-language-selector.html
with
37 additions
and
16 deletions
lms/static/sass/shared/_footer.scss
+
13
−
0
View file @
4026e2f8
...
...
@@ -202,6 +202,19 @@
cursor
:
initial
;
}
}
.select-lang-button
{
padding
:
5px
;
color
:
$m-blue-d3
!
important
;
height
:
30px
;
&
:hover
,
&
:active
,
&
:focus
{
background
:
$m-blue-d3
!
important
;
color
:
white
!
important
;
}
}
}
// edx theme overrides
...
...
This diff is collapsed.
Click to expand it.
lms/templates/widgets/footer-language-selector.html
+
24
−
16
View file @
4026e2f8
...
...
@@ -18,20 +18,26 @@
<
%
namespace
name=
'static'
file=
'../static_content.html'
/>
<div
class=
"footer-language-selector"
>
<label
for=
"footer-language-select"
>
<span
class=
"icon fa fa-globe"
aria-hidden=
"true"
></span>
<span
class=
"sr"
>
${_("Choose Language")}
</span>
</label>
<select
id=
"footer-language-select"
name=
"language"
onchange=
"footerLanguageSelector.handleSelection(this)"
>
% for language in sorted(released_languages(), key=lambda x: x.code):
<
%
language_name =
Locale.parse(language.code.replace('_',
'
-
'),
sep=
'-'
).
language_name
%
>
% if language.code == LANGUAGE_CODE:
<option
value=
"${language.code}"
selected=
"selected"
>
${language_name}
</option>
% else:
<option
value=
"${language.code}"
>
${language_name}
</option>
% endif
% endfor
</select>
<div
role=
"group"
aria-label=
"Change page language"
>
<label
for=
"footer-language-select"
>
<span
class=
"icon fa fa-globe"
aria-hidden=
"true"
></span>
<span
class=
"sr"
>
${_("Choose Language")}
</span>
</label>
<select
id=
"footer-language-select"
name=
"language"
onchange=
"footerLanguageSelector.handleSelection(this)"
>
% for language in sorted(released_languages(), key=lambda x: x.code):
<
%
language_name =
Locale.parse(language.code.replace('_',
'
-
'),
sep=
'-'
).
language_name
%
>
% if language.code == LANGUAGE_CODE:
<option
value=
"${language.code}"
selected=
"selected"
>
${language_name}
</option>
% else:
<option
value=
"${language.code}"
>
${language_name}
</option>
% endif
% endfor
</select>
<button
id=
"footer-language-button"
type=
"button"
class=
"btn-edged-blue select-lang-button"
onclick=
"footerLanguageSelector.langSelection()"
>
${_('Submit')}
</button>
</div>
</div>
<script
type=
"text/javascript"
>
...
...
@@ -48,8 +54,10 @@
##
preference
to
the
user
'
s profile. This effect may be delayed on pages that do not use the LMS language
## selection middleware.
##
handleSelection: function($select) {
this.setLanguageCookie($select.value, this.refreshPage);
langSelection: function() {
var footer = document.getElementById(
'
footer
-
language
-
select
'
);
var lang = footer.options[footer.selectedIndex].value;
this.setLanguageCookie(lang, this.refreshPage);
},
setLanguageCookie: function(value, callback) {
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment