Skip to content

Commit

Permalink
Improve parser warnings (#4702)
Browse files Browse the repository at this point in the history
Based on http://discourse.jabref.org/t/warnings-by-jabref-start/1532, in which a user (rightfully) complained that the error message is not very helpful.
  • Loading branch information
tobiasdiez authored and Siedlerchr committed Feb 27, 2019
1 parent e2ee5f4 commit 3cf609c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -703,21 +703,21 @@ private String fixKey() throws IOException {
}

// Finished, now reverse newKey and remove whitespaces:
parserResult.addWarning(
Localization.lang("Line %0: Found corrupted BibTeX key.", String.valueOf(line)));
key = newKey.reverse();
parserResult.addWarning(
Localization.lang("Line %0: Found corrupted BibTeX key %1.", String.valueOf(line), key.toString()));
}
}
break;

case ',':
parserResult.addWarning(Localization.lang("Line %0: Found corrupted BibTeX key (contains whitespaces).",
String.valueOf(line)));
parserResult.addWarning(
Localization.lang("Line %0: Found corrupted BibTeX key %1 (contains whitespaces).", String.valueOf(line), key.toString()));
break;

case '\n':
parserResult.addWarning(
Localization.lang("Line %0: Found corrupted BibTeX key (comma missing).", String.valueOf(line)));
Localization.lang("Line %0: Found corrupted BibTeX key %1 (comma missing).", String.valueOf(line), key.toString()));
break;

default:
Expand Down
7 changes: 3 additions & 4 deletions src/main/resources/l10n/JabRef_en.properties
Original file line number Diff line number Diff line change
Expand Up @@ -1160,10 +1160,9 @@ Use\ IEEE\ LaTeX\ abbreviations=Use IEEE LaTeX abbreviations

When\ opening\ file\ link,\ search\ for\ matching\ file\ if\ no\ link\ is\ defined=When opening file link, search for matching file if no link is defined
Settings\ for\ %0=Settings for %0

Line\ %0\:\ Found\ corrupted\ BibTeX\ key.=Line %0: Found corrupted BibTeX key.
Line\ %0\:\ Found\ corrupted\ BibTeX\ key\ (contains\ whitespaces).=Line %0: Found corrupted BibTeX key (contains whitespaces).
Line\ %0\:\ Found\ corrupted\ BibTeX\ key\ (comma\ missing).=Line %0: Found corrupted BibTeX key (comma missing).
Line\ %0\:\ Found\ corrupted\ BibTeX\ key\ %1.=Line %0: Found corrupted BibTeX key %1.
Line\ %0\:\ Found\ corrupted\ BibTeX\ key\ %1\ (contains\ whitespaces).=Line %0: Found corrupted BibTeX key %1 (contains whitespaces).
Line\ %0\:\ Found\ corrupted\ BibTeX\ key\ %1\ (comma\ missing).=Line %0: Found corrupted BibTeX key %1 (comma missing).
No\ full\ text\ document\ found=No full text document found
Update\ to\ current\ column\ order=Update to current column order
Download\ from\ URL=Download from URL
Expand Down

0 comments on commit 3cf609c

Please sign in to comment.