Skip to content

Commit

Permalink
Merge pull request #299 from biocore/csymons_restrict_japanese
Browse files Browse the repository at this point in the history
Restrict Japanese to Residents of Japan
  • Loading branch information
cassidysymons authored Nov 20, 2023
2 parents 217768e + 9b8866d commit 323aefb
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions microsetta_interface/templates/account_details.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,32 @@
$("#state").empty();
}
// Special case to prevent users outside Japan from using Japanese as their language
$('#language').empty();
if (code == "JP") {
{% for lang_key in languages %}
var option = $('<option></option>')
.attr('value', '{{ languages[lang_key].value }}')
{% if account.language == languages[lang_key].value %}
.attr('selected', 'selected')
{% endif %}
.text('{{ languages[lang_key].display_text }}');
$('#language').append(option);
{% endfor %}
} else {
{% for lang_key in languages %}
{% if languages[lang_key].value != "ja_JP" %}
var option = $('<option></option>')
.attr('value', '{{ languages[lang_key].value }}')
{% if account.language == languages[lang_key].value %}
.attr('selected', 'selected')
{% endif %}
.text('{{ languages[lang_key].display_text }}');
$('#language').append(option);
{% endif %}
{% endfor %}
}
// special case the use of codes for US states
if (code == "US") {
for (var state of US_STATES)
Expand Down

0 comments on commit 323aefb

Please sign in to comment.