Changeset 694


Ignore:
Timestamp:
12/09/2011 12:06:29 AM (6 months ago)
Author:
ofer
Message:

Fix calculation of batch translation size

File:
1 edited

Legend:

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

    r693 r694  
    2020    var 
    2121    // this is the size of strings to queue, we don't want too much there 
    22     BATCH_SIZE = 512, 
     22    BATCH_SIZE = 1024, 
    2323    // number of phrases that might be translated 
    2424    possibly_translateable, 
     
    301301            if (auto_translated_phrases[to_trans] !== 1) { 
    302302                auto_translated_phrases[to_trans] = 1; 
    303                 if (batchlength + to_trans.length > BATCH_SIZE) { 
     303                if (batchlength + encodeURIComponent(to_trans).length > BATCH_SIZE) { 
    304304                    do_mass_invoke(batchtokens, batchtrans); 
    305305                    batchlength = 0; 
     
    307307                    batchtokens = []; 
    308308                } 
    309                 batchlength += to_trans.length; 
     309                batchlength += encodeURIComponent(to_trans).length; 
    310310                batchtokens.push(token); 
    311311                batchtrans.push(to_trans); 
Note: See TracChangeset for help on using the changeset viewer.