Changeset 525


Ignore:
Timestamp:
08/31/2010 01:12:27 AM (18 months ago)
Author:
ofer
Message:

Fix MS translate tendency to add white space

Location:
trunk/WordPress/plugin/transposh/js
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/WordPress/plugin/transposh/js/transposh.js

    r499 r525  
    136136    // happens on traslate success 
    137137    function auto_translate_success(token, translation) { 
    138         ajax_translate(token, $("<div>" + translation + "</div>").text()); 
     138        ajax_translate(token, $("<div>" + $.trim(translation) + "</div>").text()); 
    139139        make_progress(progressbar_id, (possibly_translateable - $("." + t_jp_prefix + '[data-source=""]').size()) / possibly_translateable * 100); 
    140140    } 
  • trunk/WordPress/plugin/transposh/js/transposhadmin.js

    r495 r525  
    4141// batch items for posting to server.. nice touch added for different sources for same batch... 
    4242function ajax_translate_me(token, translation, lang, source) { 
    43     translation = jQuery("<div>" + translation + "</div>").text(); // fix some char bugs 
     43    translation = jQuery("<div>" + $.trim(translation) + "</div>").text(); // fix some char bugs 
    4444    make_progress(translation, lang); 
    4545    // we aggregate translations together, 200ms from the last translation we will send the timer 
  • trunk/WordPress/plugin/transposh/js/transposhedit.js

    r481 r525  
    9898        google_trans($("#" + t_jp.prefix + "original").val(), function (result) { 
    9999            if (result.responseStatus === 200) { 
    100                 $("#" + t_jp.prefix + "translation").val($("<div>" + result.responseData.translatedText + "</div>").text()) 
     100                $("#" + t_jp.prefix + "translation").val($("<div>" + $.trim(result.responseData.translatedText) + "</div>").text()) 
    101101                .keyup(); 
    102102            } 
     
    120120        $(":button:contains('Suggest - Google')").attr("disabled", "").removeClass("ui-state-disabled"); 
    121121        ms_trans($("#" + t_jp.prefix + "original").val(), function (translation) { 
    122             $("#" + t_jp.prefix + "translation").val($("<div>" + translation + "</div>").text()) 
     122            $("#" + t_jp.prefix + "translation").val($("<div>" + $.trim(translation) + "</div>").text()) 
    123123            .keyup(); 
    124124        }); 
Note: See TracChangeset for help on using the changeset viewer.