mirror of
https://github.com/Hopiu/django-rosetta.git
synced 2026-04-11 17:10:59 +00:00
fix for (GoogleCode) issues 112 - Sublanguages & invalid translation language pair
This commit is contained in:
parent
5ffd64915c
commit
acbd1ceac0
1 changed files with 1 additions and 1 deletions
|
|
@ -13,7 +13,7 @@ google.setOnLoadCallback(function() {
|
|||
trans=$('textarea',a.parent());
|
||||
orig = unescape(orig).replace(/<br\s?\/?>/g,'\n').replace(/<code>/g,'').replace(/<\/code>/g,'').replace(/>/g,'>').replace(/</g,'<');
|
||||
a.attr('class','suggesting').html('...');
|
||||
google.language.translate(orig, '{{MESSAGES_SOURCE_LANGUAGE_CODE}}', '{{rosetta_i18n_lang_code}}', function(result) {
|
||||
google.language.translate(orig, '{{MESSAGES_SOURCE_LANGUAGE_CODE}}', '{{rosetta_i18n_lang_code|slice:":2"}}', function(result) {
|
||||
if (!result.error) {
|
||||
trans.val(unescape(result.translation).replace(/'/g,'\'').replace(/"/g,'"').replace(/%\s+(\([^\)]+\))\s*s/g,' %$1s '));
|
||||
a.hide();
|
||||
|
|
|
|||
Loading…
Reference in a new issue