Skip to content

Commit

Permalink
Use language code without country specification for Yandex destinatio…
Browse files Browse the repository at this point in the history
…n lang
  • Loading branch information
nealtodd committed Jan 28, 2016
1 parent 20de6bf commit e3689af
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion rosetta/templates/rosetta/js/rosetta.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,15 @@ google.setOnLoadCallback(function() {
var orig = $('.original .message', a.parents('tr')).html();
var trans=$('textarea',a.parent());
var apiUrl = "https://translate.yandex.net/api/v1.5/tr.json/translate";
var destLangRoot = '{{ rosetta_i18n_lang_code }}'.split('-')[0];
var lang = '{{ rosetta_settings.MESSAGES_SOURCE_LANGUAGE_CODE }}-' + destLangRoot;

a.attr('class','suggesting').html('...');

var apiData = {
error: 'onTranslationError',
success: 'onTranslationComplete',
lang: '{{ rosetta_settings.MESSAGES_SOURCE_LANGUAGE_CODE }}-{{ rosetta_i18n_lang_code }}',
lang: lang,
key: '{{ rosetta_settings.YANDEX_TRANSLATE_KEY }}',
format: 'html',
text: orig
Expand Down

0 comments on commit e3689af

Please sign in to comment.