From e3689afa76e495e44e00780e799eb2c6aff248d0 Mon Sep 17 00:00:00 2001 From: Neal Todd Date: Thu, 28 Jan 2016 14:00:08 +0000 Subject: [PATCH] Use language code without country specification for Yandex destination lang --- rosetta/templates/rosetta/js/rosetta.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/rosetta/templates/rosetta/js/rosetta.js b/rosetta/templates/rosetta/js/rosetta.js index 0fe40558..c2bbf8e1 100644 --- a/rosetta/templates/rosetta/js/rosetta.js +++ b/rosetta/templates/rosetta/js/rosetta.js @@ -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