Skip to content

Commit

Permalink
Fixed issue #5411: Quick translation does not work if contents contai…
Browse files Browse the repository at this point in the history
…ns double quotes

git-svn-id: file:///Users/Shitiz/Downloads/lssvn/source/limesurvey_ci@10834 b72ed6b6-b9f8-46b5-92b4-906544132732
  • Loading branch information
c-schmitz committed Aug 24, 2011
1 parent 2b4828b commit 55b12e5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
6 changes: 3 additions & 3 deletions application/libraries/admin/gtranslate/languages.ini
Expand Up @@ -33,7 +33,7 @@ FRISIAN = fy
GALICIAN = gl
GEORGIAN = ka
GERMAN = de
GERMAN = de-informal
GERMAN INFORMAL= de-informal
GREEK = el
GUJARATI = gu
HAITIAN_CREOLE = ht
Expand Down Expand Up @@ -67,8 +67,8 @@ MARATHI = mr
MONGOLIAN = mn
NEPALI = ne
NORWEGIAN = no
NORWEGIAN = nn
NORWEGIAN = nb
NORWEGIAN NYNORSK = nn
NORWEGIAN BOKMAL = nb
OCCITAN = oc
ORIYA = or
PASHTO = ps
Expand Down
11 changes: 6 additions & 5 deletions scripts/admin/translation.js
@@ -1,4 +1,4 @@
// $Id: tokens.js 8633 2010-04-25 12:57:33Z c_schmitz
// $Id: tokens.js 8633 2010-04-25 12:57:33Z c_schmitz
$(document).ready(function(){

intThrottlingRate = 550; // 1 request per 550 ms
Expand Down Expand Up @@ -37,21 +37,22 @@ $(document).ready(function(){

if (!sTargetInnerText)
sTargetInnerText = ""

if (sTargetInnerText.length > 0){
bIgnore = true;
}

if (sTargetInnerText == strip(sToConvert)){
bIgnore = false;
}
}

if (!bIgnore){
sToConvert = sToConvert.replace( new RegExp( "\\n", "g" ),'\\n');
sToConvert = sToConvert.replace(/"/g,'\\"');
setTimeout('fDoTranslateAjax("'+sBaseLang+'","'+sToLang+'","'+sToConvert+'","'+sId+'");',index*intThrottlingRate)
}

});

setTimeout('fHideAjaxLoader();',($("._from_",$(ui.target).parent()).length)*intThrottlingRate)
Expand Down Expand Up @@ -88,7 +89,7 @@ function fDoTranslateAjax(sBaseLang,sToLang,sToConvert,sId)
$("[name="+sId+"]").html(aData.converted);

var oMyEditor = CKEDITOR.instances[sId];

if (oMyEditor)
{
oMyEditor.setData(aData.converted);
Expand Down

0 comments on commit 55b12e5

Please sign in to comment.