Skip to content

Commit

Permalink
Merge pull request #152 from nealtodd/yandex-lang-string
Browse files Browse the repository at this point in the history
Use language code without country specification for Yandex dest lang
  • Loading branch information
mbi committed Feb 8, 2016
2 parents 20de6bf + e3689af commit 65fa6f1
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 65fa6f1

Please sign in to comment.