Use ASCII for translator filenames
Remove diacritics and then use translatorID for anything that still has extended characters. Fixes #459, Non-ascii translator names
This commit is contained in:
parent
53449d47a9
commit
d821778d24
1 changed files with 12 additions and 2 deletions
|
@ -692,7 +692,12 @@ Zotero.Schema = new function(){
|
|||
}
|
||||
}
|
||||
|
||||
var fileName = Zotero.File.getValidFileName(entry.label) + fileExt;
|
||||
var fileName = Zotero.Utilities.removeDiacritics(
|
||||
Zotero.File.getValidFileName(entry.label)) + fileExt;
|
||||
// Use translatorID if name still isn't ASCII (e.g., Cyrillic)
|
||||
if (!fileName.match(/^[\x00-\x7f]+$/)) {
|
||||
fileName = entry.translatorID + fileExt;
|
||||
}
|
||||
|
||||
var destFile = destDir.clone();
|
||||
destFile.append(fileName);
|
||||
|
@ -815,7 +820,12 @@ Zotero.Schema = new function(){
|
|||
}
|
||||
|
||||
if (mode == 'translator') {
|
||||
var fileName = Zotero.File.getValidFileName(newObj[titleField]) + fileExt
|
||||
var fileName = Zotero.Utilities.removeDiacritics(
|
||||
Zotero.File.getValidFileName(newObj[titleField])) + fileExt;
|
||||
// Use translatorID if name still isn't ASCII (e.g., Cyrillic)
|
||||
if (!fileName.match(/^[\x00-\x7f]+$/)) {
|
||||
fileName = newObj.translatorID + fileExt;
|
||||
}
|
||||
}
|
||||
else if (mode == 'style') {
|
||||
var fileName = file.leafName;
|
||||
|
|
Loading…
Add table
Reference in a new issue