Skip to content

Commit

Permalink
Code refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
suminb committed Dec 26, 2015
1 parent 79d1478 commit ac46c8d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions app/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,8 @@ <h3>Opps...</h3>
.trigger("change");

// Dynamically set the available languages
$.get(sprintf('/api/v1.3/languages?locale=%s&field=source', locale), function(response) {
var lurl = sprintf('/api/v1.3/languages?locale=%s&field=source', locale);
$.get(lurl, function(response) {
var languages = $.map(response.languages, function(pair) {
return {label: pair[1], value: pair[0]};
});
Expand All @@ -195,7 +196,8 @@ <h3>Opps...</h3>
model.set('targetLanguage', tl ? tl : 'ko');
});

$.get(sprintf('/api/v1.3/languages?locale=%s&field=intermediate&sortby=-1', locale), function(response) {
var ilurl = sprintf('/api/v1.3/languages?locale=%s&field=intermediate&sortby=-1', locale);
$.get(ilurl, function(response) {
var languages = $.map(response.languages, function(pair) {
return {label: pair[1], value: pair[0]};
});
Expand Down

0 comments on commit ac46c8d

Please sign in to comment.