Ticket #1278: 08-cjk-names.patch

File 08-cjk-names.patch, 1.5 KB (added by fbennett, 8 years ago)
  • chrome/content/zotero/xpcom/csl.js

    Only in zotero-trunk/chrome/content/zotero: addCitationDialog.js.orig
    Only in zotero-trunk/chrome/content/zotero: addCitationDialog.js.rej
    diff -r -u zotero-trunk.orig/chrome/content/zotero/xpcom/csl.js zotero-trunk/chrome/content/zotero/xpcom/csl.js
    old new  
    622622                                                var firstName, lastName; 
    623623                                                // parse authors into strings 
    624624                                                for(var i=0; i<maxCreators; i++) { 
     625                                                        // fetch first names early, for use in condition statement 
     626                                                        // should work out how to minimize assignments to first and 
     627                                                        // last name vars 
     628                                                        var lastName = creators[i].getNameVariable("lastName"); 
    625629                                                        if(formattedString.format == "Sort") { 
    626630                                                                // for sort, we use the plain names 
    627631                                                                var name = creators[i].getNameVariable("lastName"); 
     
    645649                                                                name += firstName; 
    646650                                                                 
    647651                                                                newString.append(name); 
     652                                                        } else if ( lastName.match(/^[^\0-\u007f].*/) ) { 
     653                                                                var firstName = creators[i].getNameVariable("firstName"); 
     654                                                                authorStrings.push(lastName+firstName); 
    648655                                                        } else { 
    649656                                                                var firstName = ""; 
    650657