From efd80e0fe0edecfcd40058bbca72fa6cbf1923ad Mon Sep 17 00:00:00 2001 From: Oliver Kopp Date: Tue, 6 Aug 2024 20:54:03 +0200 Subject: [PATCH] Localize getDescription() and remove meaningless test methods --- .../BibliographyFromPdfImporter.java | 2 +- .../fileformat/BiblioscapeImporter.java | 3 +- .../importer/fileformat/BibtexImporter.java | 3 +- .../importer/fileformat/CffImporter.java | 3 +- .../fileformat/CitaviXmlImporter.java | 3 +- .../importer/fileformat/CopacImporter.java | 3 +- .../importer/fileformat/EndnoteImporter.java | 3 +- .../fileformat/EndnoteXmlImporter.java | 3 +- .../importer/fileformat/InspecImporter.java | 3 +- .../importer/fileformat/IsiImporter.java | 3 +- .../importer/fileformat/MedlineImporter.java | 3 +- .../fileformat/MedlinePlainImporter.java | 3 +- .../importer/fileformat/ModsImporter.java | 3 +- .../importer/fileformat/MrDLibImporter.java | 2 +- .../importer/fileformat/MsBibImporter.java | 3 +- .../importer/fileformat/OvidImporter.java | 3 +- .../fileformat/PdfContentImporter.java | 2 +- .../PdfEmbeddedBibFileImporter.java | 6 ++-- .../fileformat/PdfGrobidImporter.java | 3 +- .../PdfVerbatimBibTextImporter.java | 2 +- .../importer/fileformat/PdfXmpImporter.java | 2 +- .../importer/fileformat/RepecNepImporter.java | 3 +- .../importer/fileformat/RisImporter.java | 3 +- src/main/resources/l10n/JabRef_en.properties | 23 ++++++++++++++ .../fileformat/InspecImporterTest.java | 5 --- .../importer/fileformat/IsiImporterTest.java | 6 ---- .../fileformat/MedlineImporterTest.java | 5 --- .../fileformat/MedlinePlainImporterTest.java | 11 ------- .../fileformat/MrDLibImporterTest.java | 16 ---------- .../fileformat/MsBibImporterTest.java | 29 +++++------------ .../importer/fileformat/OvidImporterTest.java | 29 +---------------- .../fileformat/PdfContentImporterTest.java | 12 ------- .../PdfEmbeddedBibFileImporterTest.java | 12 ------- .../PdfMergeMetadataImporterTest.java | 11 ------- .../PdfVerbatimBibTextImporterTest.java | 12 ------- .../fileformat/PdfXmpImporterTest.java | 16 ---------- .../importer/fileformat/RISImporterTest.java | 31 +------------------ .../fileformat/RepecNepImporterTest.java | 24 -------------- 38 files changed, 74 insertions(+), 235 deletions(-) diff --git a/src/main/java/org/jabref/logic/importer/fileformat/BibliographyFromPdfImporter.java b/src/main/java/org/jabref/logic/importer/fileformat/BibliographyFromPdfImporter.java index 49d3ffa6291..9f7cd053bfd 100644 --- a/src/main/java/org/jabref/logic/importer/fileformat/BibliographyFromPdfImporter.java +++ b/src/main/java/org/jabref/logic/importer/fileformat/BibliographyFromPdfImporter.java @@ -96,7 +96,7 @@ public String getName() { @Override public String getDescription() { - return "Reads the references from the 'References' section of a PDF file."; + return Localization.lang("Reads the references from the 'References' section of a PDF file."); } @Override diff --git a/src/main/java/org/jabref/logic/importer/fileformat/BiblioscapeImporter.java b/src/main/java/org/jabref/logic/importer/fileformat/BiblioscapeImporter.java index 8df99e6b74f..6809ee55060 100644 --- a/src/main/java/org/jabref/logic/importer/fileformat/BiblioscapeImporter.java +++ b/src/main/java/org/jabref/logic/importer/fileformat/BiblioscapeImporter.java @@ -11,6 +11,7 @@ import org.jabref.logic.importer.Importer; import org.jabref.logic.importer.ParserResult; +import org.jabref.logic.l10n.Localization; import org.jabref.logic.util.StandardFileType; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.Field; @@ -38,7 +39,7 @@ public StandardFileType getFileType() { @Override public String getDescription() { - return "Imports a Biblioscape Tag File.\nSeveral Biblioscape field types are ignored. Others are only included in the BibTeX field \"comment\"."; + return Localization.lang("Imports a Biblioscape Tag File.\nSeveral Biblioscape field types are ignored. Others are only included in the BibTeX field \"comment\"."); } @Override diff --git a/src/main/java/org/jabref/logic/importer/fileformat/BibtexImporter.java b/src/main/java/org/jabref/logic/importer/fileformat/BibtexImporter.java index b3c17bc49ad..e78f4d7db2e 100644 --- a/src/main/java/org/jabref/logic/importer/fileformat/BibtexImporter.java +++ b/src/main/java/org/jabref/logic/importer/fileformat/BibtexImporter.java @@ -17,6 +17,7 @@ import org.jabref.logic.importer.ImportFormatPreferences; import org.jabref.logic.importer.Importer; import org.jabref.logic.importer.ParserResult; +import org.jabref.logic.l10n.Localization; import org.jabref.logic.util.StandardFileType; import org.jabref.model.database.BibDatabaseModeDetection; import org.jabref.model.util.FileUpdateMonitor; @@ -139,7 +140,7 @@ public StandardFileType getFileType() { @Override public String getDescription() { - return "This importer enables `--importToOpen someEntry.bib`"; + return Localization.lang("This importer enables \"--importToOpen someEntry.bib\""); } /** diff --git a/src/main/java/org/jabref/logic/importer/fileformat/CffImporter.java b/src/main/java/org/jabref/logic/importer/fileformat/CffImporter.java index 7a180d79c38..7b8ce084367 100644 --- a/src/main/java/org/jabref/logic/importer/fileformat/CffImporter.java +++ b/src/main/java/org/jabref/logic/importer/fileformat/CffImporter.java @@ -12,6 +12,7 @@ import org.jabref.logic.exporter.CffExporter; import org.jabref.logic.importer.Importer; import org.jabref.logic.importer.ParserResult; +import org.jabref.logic.l10n.Localization; import org.jabref.logic.util.StandardFileType; import org.jabref.model.entry.Author; import org.jabref.model.entry.AuthorList; @@ -57,7 +58,7 @@ public String getId() { @Override public String getDescription() { - return "Importer for the CFF format, which is intended to make software and datasets citable."; + return Localization.lang("Importer for the CFF format, which is intended to make software and datasets citable."); } // POJO classes for yaml data diff --git a/src/main/java/org/jabref/logic/importer/fileformat/CitaviXmlImporter.java b/src/main/java/org/jabref/logic/importer/fileformat/CitaviXmlImporter.java index 667769fe34a..78b0400932c 100644 --- a/src/main/java/org/jabref/logic/importer/fileformat/CitaviXmlImporter.java +++ b/src/main/java/org/jabref/logic/importer/fileformat/CitaviXmlImporter.java @@ -37,6 +37,7 @@ import org.jabref.logic.importer.fileformat.citavi.CitaviExchangeData.KnowledgeItems; import org.jabref.logic.importer.fileformat.citavi.CitaviExchangeData.KnowledgeItems.KnowledgeItem; import org.jabref.logic.importer.fileformat.citavi.CitaviExchangeData.Persons.Person; +import org.jabref.logic.l10n.Localization; import org.jabref.logic.util.StandardFileType; import org.jabref.model.entry.Author; import org.jabref.model.entry.AuthorList; @@ -108,7 +109,7 @@ public String getId() { @Override public String getDescription() { - return "Importer for the Citavi XML format."; + return Localization.lang("Importer for the Citavi XML format."); } @Override diff --git a/src/main/java/org/jabref/logic/importer/fileformat/CopacImporter.java b/src/main/java/org/jabref/logic/importer/fileformat/CopacImporter.java index d771ac42787..b5192be5509 100644 --- a/src/main/java/org/jabref/logic/importer/fileformat/CopacImporter.java +++ b/src/main/java/org/jabref/logic/importer/fileformat/CopacImporter.java @@ -9,6 +9,7 @@ import org.jabref.logic.importer.Importer; import org.jabref.logic.importer.ParserResult; +import org.jabref.logic.l10n.Localization; import org.jabref.logic.util.StandardFileType; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.Field; @@ -43,7 +44,7 @@ public String getId() { @Override public String getDescription() { - return "Importer for COPAC format."; + return Localization.lang("Importer for COPAC format."); } @Override diff --git a/src/main/java/org/jabref/logic/importer/fileformat/EndnoteImporter.java b/src/main/java/org/jabref/logic/importer/fileformat/EndnoteImporter.java index b4f9fe0f1bc..2112f9f4350 100644 --- a/src/main/java/org/jabref/logic/importer/fileformat/EndnoteImporter.java +++ b/src/main/java/org/jabref/logic/importer/fileformat/EndnoteImporter.java @@ -11,6 +11,7 @@ import org.jabref.logic.citationkeypattern.CitationKeyGenerator; import org.jabref.logic.importer.Importer; import org.jabref.logic.importer.ParserResult; +import org.jabref.logic.l10n.Localization; import org.jabref.logic.util.StandardFileType; import org.jabref.model.entry.AuthorList; import org.jabref.model.entry.BibEntry; @@ -52,7 +53,7 @@ public String getId() { @Override public String getDescription() { - return "Importer for the Refer/Endnote format. Modified to use article number for pages if pages are missing."; + return Localization.lang("Importer for the Refer/Endnote format. Modified to use article number for pages if pages are missing."); } @Override diff --git a/src/main/java/org/jabref/logic/importer/fileformat/EndnoteXmlImporter.java b/src/main/java/org/jabref/logic/importer/fileformat/EndnoteXmlImporter.java index 5c7f3aa6777..ec89f849cd4 100644 --- a/src/main/java/org/jabref/logic/importer/fileformat/EndnoteXmlImporter.java +++ b/src/main/java/org/jabref/logic/importer/fileformat/EndnoteXmlImporter.java @@ -23,6 +23,7 @@ import org.jabref.logic.importer.ParseException; import org.jabref.logic.importer.Parser; import org.jabref.logic.importer.ParserResult; +import org.jabref.logic.l10n.Localization; import org.jabref.logic.util.StandardFileType; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.KeywordList; @@ -121,7 +122,7 @@ public String getId() { @Override public String getDescription() { - return "Importer for the EndNote XML format."; + return Localization.lang("Importer for the EndNote XML format."); } @Override diff --git a/src/main/java/org/jabref/logic/importer/fileformat/InspecImporter.java b/src/main/java/org/jabref/logic/importer/fileformat/InspecImporter.java index e1b6b52fc75..dd0e60dc011 100644 --- a/src/main/java/org/jabref/logic/importer/fileformat/InspecImporter.java +++ b/src/main/java/org/jabref/logic/importer/fileformat/InspecImporter.java @@ -10,6 +10,7 @@ import org.jabref.logic.importer.Importer; import org.jabref.logic.importer.ParserResult; +import org.jabref.logic.l10n.Localization; import org.jabref.logic.util.StandardFileType; import org.jabref.model.entry.AuthorList; import org.jabref.model.entry.BibEntry; @@ -38,7 +39,7 @@ public StandardFileType getFileType() { @Override public String getDescription() { - return "INSPEC format importer."; + return Localization.lang("Importer for the INSPEC format."); } @Override diff --git a/src/main/java/org/jabref/logic/importer/fileformat/IsiImporter.java b/src/main/java/org/jabref/logic/importer/fileformat/IsiImporter.java index 47a1ef7967e..ab376a82cd2 100644 --- a/src/main/java/org/jabref/logic/importer/fileformat/IsiImporter.java +++ b/src/main/java/org/jabref/logic/importer/fileformat/IsiImporter.java @@ -15,6 +15,7 @@ import org.jabref.logic.formatter.casechanger.TitleCaseFormatter; import org.jabref.logic.importer.Importer; import org.jabref.logic.importer.ParserResult; +import org.jabref.logic.l10n.Localization; import org.jabref.logic.util.StandardFileType; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.Month; @@ -72,7 +73,7 @@ public String getId() { @Override public String getDescription() { - return "Importer for the ISI Web of Science, INSPEC and Medline format."; + return Localization.lang("Importer for the ISI Web of Science, INSPEC and Medline format."); } @Override diff --git a/src/main/java/org/jabref/logic/importer/fileformat/MedlineImporter.java b/src/main/java/org/jabref/logic/importer/fileformat/MedlineImporter.java index 0cece860424..3a18c4c0476 100644 --- a/src/main/java/org/jabref/logic/importer/fileformat/MedlineImporter.java +++ b/src/main/java/org/jabref/logic/importer/fileformat/MedlineImporter.java @@ -29,6 +29,7 @@ import org.jabref.logic.importer.fileformat.medline.OtherId; import org.jabref.logic.importer.fileformat.medline.PersonalNameSubject; import org.jabref.logic.importer.util.MathMLParser; +import org.jabref.logic.l10n.Localization; import org.jabref.logic.util.StandardFileType; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.Date; @@ -85,7 +86,7 @@ public String getId() { @Override public String getDescription() { - return "Importer for the Medline format."; + return Localization.lang("Importer for the Medline format."); } @Override diff --git a/src/main/java/org/jabref/logic/importer/fileformat/MedlinePlainImporter.java b/src/main/java/org/jabref/logic/importer/fileformat/MedlinePlainImporter.java index d383377bd12..64281fc2812 100644 --- a/src/main/java/org/jabref/logic/importer/fileformat/MedlinePlainImporter.java +++ b/src/main/java/org/jabref/logic/importer/fileformat/MedlinePlainImporter.java @@ -12,6 +12,7 @@ import org.jabref.logic.importer.ImportFormatPreferences; import org.jabref.logic.importer.Importer; import org.jabref.logic.importer.ParserResult; +import org.jabref.logic.l10n.Localization; import org.jabref.logic.util.StandardFileType; import org.jabref.model.entry.AuthorList; import org.jabref.model.entry.BibEntry; @@ -51,7 +52,7 @@ public StandardFileType getFileType() { @Override public String getDescription() { - return "Importer for the MedlinePlain format."; + return Localization.lang("Importer for the MedlinePlain format."); } @Override diff --git a/src/main/java/org/jabref/logic/importer/fileformat/ModsImporter.java b/src/main/java/org/jabref/logic/importer/fileformat/ModsImporter.java index 0437cd611ce..e38743f294a 100644 --- a/src/main/java/org/jabref/logic/importer/fileformat/ModsImporter.java +++ b/src/main/java/org/jabref/logic/importer/fileformat/ModsImporter.java @@ -30,6 +30,7 @@ import org.jabref.logic.importer.fileformat.mods.Identifier; import org.jabref.logic.importer.fileformat.mods.Name; import org.jabref.logic.importer.fileformat.mods.RecordInfo; +import org.jabref.logic.l10n.Localization; import org.jabref.logic.util.StandardFileType; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.Date; @@ -624,7 +625,7 @@ public StandardFileType getFileType() { @Override public String getDescription() { - return "Importer for the MODS format"; + return Localization.lang("Importer for the MODS format."); } @Override diff --git a/src/main/java/org/jabref/logic/importer/fileformat/MrDLibImporter.java b/src/main/java/org/jabref/logic/importer/fileformat/MrDLibImporter.java index b03be074ece..8d21d2465e1 100644 --- a/src/main/java/org/jabref/logic/importer/fileformat/MrDLibImporter.java +++ b/src/main/java/org/jabref/logic/importer/fileformat/MrDLibImporter.java @@ -66,7 +66,7 @@ public StandardFileType getFileType() { @Override public String getDescription() { - return "Takes valid JSON documents from the Mr. DLib API and parses them into a BibEntry"; + return "Takes valid JSON documents from the Mr. DLib API and parses them into a BibEntry."; } /** diff --git a/src/main/java/org/jabref/logic/importer/fileformat/MsBibImporter.java b/src/main/java/org/jabref/logic/importer/fileformat/MsBibImporter.java index f162f5e9c84..c633f88d09e 100644 --- a/src/main/java/org/jabref/logic/importer/fileformat/MsBibImporter.java +++ b/src/main/java/org/jabref/logic/importer/fileformat/MsBibImporter.java @@ -10,6 +10,7 @@ import org.jabref.logic.importer.Importer; import org.jabref.logic.importer.ParserResult; +import org.jabref.logic.l10n.Localization; import org.jabref.logic.msbib.MSBibDatabase; import org.jabref.logic.util.StandardFileType; @@ -87,7 +88,7 @@ public StandardFileType getFileType() { @Override public String getDescription() { - return "Importer for the MS Office 2007 XML bibliography format."; + return Localization.lang("Importer for the MS Office 2007 XML bibliography format."); } /** diff --git a/src/main/java/org/jabref/logic/importer/fileformat/OvidImporter.java b/src/main/java/org/jabref/logic/importer/fileformat/OvidImporter.java index bcea23f0489..c9019585e7e 100644 --- a/src/main/java/org/jabref/logic/importer/fileformat/OvidImporter.java +++ b/src/main/java/org/jabref/logic/importer/fileformat/OvidImporter.java @@ -11,6 +11,7 @@ import org.jabref.logic.importer.Importer; import org.jabref.logic.importer.ParserResult; +import org.jabref.logic.l10n.Localization; import org.jabref.logic.util.StandardFileType; import org.jabref.model.entry.AuthorList; import org.jabref.model.entry.BibEntry; @@ -59,7 +60,7 @@ public StandardFileType getFileType() { @Override public String getDescription() { - return "Imports an Ovid file."; + return Localization.lang("Importer for the Ovid format."); } @Override diff --git a/src/main/java/org/jabref/logic/importer/fileformat/PdfContentImporter.java b/src/main/java/org/jabref/logic/importer/fileformat/PdfContentImporter.java index b48283e06b4..2f857cb9528 100644 --- a/src/main/java/org/jabref/logic/importer/fileformat/PdfContentImporter.java +++ b/src/main/java/org/jabref/logic/importer/fileformat/PdfContentImporter.java @@ -592,6 +592,6 @@ public StandardFileType getFileType() { @Override public String getDescription() { - return "PdfContentImporter parses data of the first page of the PDF and creates a BibTeX entry. Currently, Springer and IEEE formats are supported."; + return Localization.lang("This importer parses data of the first page of the PDF and creates a BibTeX entry. Currently, Springer and IEEE formats are supported."); } } diff --git a/src/main/java/org/jabref/logic/importer/fileformat/PdfEmbeddedBibFileImporter.java b/src/main/java/org/jabref/logic/importer/fileformat/PdfEmbeddedBibFileImporter.java index 57b94653d62..0406488f8ba 100644 --- a/src/main/java/org/jabref/logic/importer/fileformat/PdfEmbeddedBibFileImporter.java +++ b/src/main/java/org/jabref/logic/importer/fileformat/PdfEmbeddedBibFileImporter.java @@ -48,14 +48,14 @@ public boolean isRecognizedFormat(BufferedReader input) throws IOException { @Override public ParserResult importDatabase(BufferedReader reader) throws IOException { Objects.requireNonNull(reader); - throw new UnsupportedOperationException("PdfEmbeddedBibFileImporter does not support importDatabase(BufferedReader reader)." + throw new UnsupportedOperationException("PdfEmbeddedBibFileImporter does not support importDatabase(BufferedReader reader). " + "Instead use importDatabase(Path filePath, Charset defaultEncoding)."); } @Override public ParserResult importDatabase(String data) throws IOException { Objects.requireNonNull(data); - throw new UnsupportedOperationException("PdfEmbeddedBibFileImporter does not support importDatabase(String data)." + throw new UnsupportedOperationException("PdfEmbeddedBibFileImporter does not support importDatabase(String data). " + "Instead use importDatabase(Path filePath, Charset defaultEncoding)."); } @@ -157,6 +157,6 @@ public StandardFileType getFileType() { @Override public String getDescription() { - return "PdfEmbeddedBibFileImporter imports an embedded Bib-File from the PDF."; + return Localization.lang("Imports a BibTeX file found inside a PDF."); } } diff --git a/src/main/java/org/jabref/logic/importer/fileformat/PdfGrobidImporter.java b/src/main/java/org/jabref/logic/importer/fileformat/PdfGrobidImporter.java index 98893d3941e..95ee3f4b6f8 100644 --- a/src/main/java/org/jabref/logic/importer/fileformat/PdfGrobidImporter.java +++ b/src/main/java/org/jabref/logic/importer/fileformat/PdfGrobidImporter.java @@ -11,6 +11,7 @@ import org.jabref.logic.importer.Importer; import org.jabref.logic.importer.ParserResult; import org.jabref.logic.importer.util.GrobidService; +import org.jabref.logic.l10n.Localization; import org.jabref.logic.util.StandardFileType; import org.jabref.logic.util.io.FileUtil; import org.jabref.model.entry.BibEntry; @@ -91,6 +92,6 @@ public String getId() { @Override public String getDescription() { - return "Wraps the GrobidService function to be used as an Importer."; + return Localization.lang("Imports BibTeX data of a PDF using Grobid."); } } diff --git a/src/main/java/org/jabref/logic/importer/fileformat/PdfVerbatimBibTextImporter.java b/src/main/java/org/jabref/logic/importer/fileformat/PdfVerbatimBibTextImporter.java index 67feff964b7..9848075eedf 100644 --- a/src/main/java/org/jabref/logic/importer/fileformat/PdfVerbatimBibTextImporter.java +++ b/src/main/java/org/jabref/logic/importer/fileformat/PdfVerbatimBibTextImporter.java @@ -94,6 +94,6 @@ public StandardFileType getFileType() { @Override public String getDescription() { - return "PdfVerbatimBibTextImporter imports a verbatim BibTeX entry from the first page of the PDF."; + return Localization.lang("Scrapes the first page of a PDF for BibTeX information."); } } diff --git a/src/main/java/org/jabref/logic/importer/fileformat/PdfXmpImporter.java b/src/main/java/org/jabref/logic/importer/fileformat/PdfXmpImporter.java index 0b8fe47c3dc..f9398633b78 100644 --- a/src/main/java/org/jabref/logic/importer/fileformat/PdfXmpImporter.java +++ b/src/main/java/org/jabref/logic/importer/fileformat/PdfXmpImporter.java @@ -83,6 +83,6 @@ public String getId() { @Override public String getDescription() { - return "Wraps the XMPUtility function to be used as an Importer."; + return Localization.lang("Imports BibTeX data using XMP data of a PDF."); } } diff --git a/src/main/java/org/jabref/logic/importer/fileformat/RepecNepImporter.java b/src/main/java/org/jabref/logic/importer/fileformat/RepecNepImporter.java index bdaaf19ad0e..19df88f0979 100644 --- a/src/main/java/org/jabref/logic/importer/fileformat/RepecNepImporter.java +++ b/src/main/java/org/jabref/logic/importer/fileformat/RepecNepImporter.java @@ -11,6 +11,7 @@ import org.jabref.logic.importer.ImportFormatPreferences; import org.jabref.logic.importer.Importer; import org.jabref.logic.importer.ParserResult; +import org.jabref.logic.l10n.Localization; import org.jabref.logic.util.StandardFileType; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.Date; @@ -170,7 +171,7 @@ public StandardFileType getFileType() { @Override public String getDescription() { - return "Imports a New Economics Papers-Message from the REPEC-NEP Service."; + return Localization.lang("Imports a New Economics Papers-Message from the REPEC-NEP Service."); } @Override diff --git a/src/main/java/org/jabref/logic/importer/fileformat/RisImporter.java b/src/main/java/org/jabref/logic/importer/fileformat/RisImporter.java index ca94829a6e7..fd1d26864da 100644 --- a/src/main/java/org/jabref/logic/importer/fileformat/RisImporter.java +++ b/src/main/java/org/jabref/logic/importer/fileformat/RisImporter.java @@ -16,6 +16,7 @@ import org.jabref.logic.importer.Importer; import org.jabref.logic.importer.ParserResult; +import org.jabref.logic.l10n.Localization; import org.jabref.logic.util.StandardFileType; import org.jabref.model.entry.AuthorList; import org.jabref.model.entry.BibEntry; @@ -45,7 +46,7 @@ public StandardFileType getFileType() { @Override public String getDescription() { - return "Imports a Biblioscape Tag File."; + return Localization.lang("Imports a Biblioscape tag file."); } @Override diff --git a/src/main/resources/l10n/JabRef_en.properties b/src/main/resources/l10n/JabRef_en.properties index 798ef3587da..72dc906d79f 100644 --- a/src/main/resources/l10n/JabRef_en.properties +++ b/src/main/resources/l10n/JabRef_en.properties @@ -351,7 +351,30 @@ Could\ not\ extract\ Metadata\ from\:\ %0=Could not extract Metadata from: %0 Parse\ Metadata\ from\ PDF.=Parse Metadata from PDF. Merge\ PDF\ metadata=Merge PDF metadata +Importer\ for\ COPAC\ format.=Importer for COPAC format. +Importer\ for\ the\ CFF\ format,\ which\ is\ intended\ to\ make\ software\ and\ datasets\ citable.=Importer for the CFF format, which is intended to make software and datasets citable. +Importer\ for\ the\ Citavi\ XML\ format.=Importer for the Citavi XML format. +Importer\ for\ the\ EndNote\ XML\ format.=Importer for the EndNote XML format. +Importer\ for\ the\ INSPEC\ format.=Importer for the INSPEC format. +Importer\ for\ the\ ISI\ Web\ of\ Science,\ INSPEC\ and\ Medline\ format.=Importer for the ISI Web of Science, INSPEC and Medline format. +Importer\ for\ the\ MODS\ format.=Importer for the MODS format. +Importer\ for\ the\ MS\ Office\ 2007\ XML\ bibliography\ format.=Importer for the MS Office 2007 XML bibliography format. +Importer\ for\ the\ Medline\ format.=Importer for the Medline format. +Importer\ for\ the\ MedlinePlain\ format.=Importer for the MedlinePlain format. +Importer\ for\ the\ Ovid\ format.=Importer for the Ovid format. +Importer\ for\ the\ Refer/Endnote\ format.\ Modified\ to\ use\ article\ number\ for\ pages\ if\ pages\ are\ missing.=Importer for the Refer/Endnote format. Modified to use article number for pages if pages are missing. Imports\ BibTeX\ data\ from\ a\ PDF\ using\ multiple\ strategies\ (e.g.,\ XMP,\ embedded\ BibTeX,\ text\ parsing,\ Grobid,\ and\ DOI\ lookup)\ and\ merges\ the\ result.=Imports BibTeX data from a PDF using multiple strategies (e.g., XMP, embedded BibTeX, text parsing, Grobid, and DOI lookup) and merges the result. +Imports\ BibTeX\ data\ of\ a\ PDF\ using\ Grobid.=Imports BibTeX data of a PDF using Grobid. +Imports\ BibTeX\ data\ using\ XMP\ data\ of\ a\ PDF.=Imports BibTeX data using XMP data of a PDF. +Imports\ a\ BibTeX\ file\ found\ inside\ a\ PDF.=Imports a BibTeX file found inside a PDF. +Imports\ a\ Biblioscape\ Tag\ File.\nSeveral\ Biblioscape\ field\ types\ are\ ignored.\ Others\ are\ only\ included\ in\ the\ BibTeX\ field\ "comment".=Imports a Biblioscape Tag File.\nSeveral Biblioscape field types are ignored. Others are only included in the BibTeX field "comment". +Imports\ a\ Biblioscape\ tag\ file.=Imports a Biblioscape tag file. +Imports\ a\ New\ Economics\ Papers-Message\ from\ the\ REPEC-NEP\ Service.=Imports a New Economics Papers-Message from the REPEC-NEP Service. +No\ BibTeX\ was\ found.\ An\ empty\ entry\ was\ created\ with\ file\ link.=No BibTeX was found. An empty entry was created with file link. +Reads\ the\ references\ from\ the\ 'References'\ section\ of\ a\ PDF\ file.=Reads the references from the 'References' section of a PDF file. +Scrapes\ the\ first\ page\ of\ a\ PDF\ for\ BibTeX\ information.=Scrapes the first page of a PDF for BibTeX information. +This\ importer\ enables\ "--importToOpen\ someEntry.bib"=This importer enables "--importToOpen someEntry.bib" +This\ importer\ parses\ data\ of\ the\ first\ page\ of\ the\ PDF\ and\ creates\ a\ BibTeX\ entry.\ Currently,\ Springer\ and\ IEEE\ formats\ are\ supported.=This importer parses data of the first page of the PDF and creates a BibTeX entry. Currently, Springer and IEEE formats are supported. Exporting\ %0=Exporting %0 Could\ not\ export\ file\ '%0'\ (reason\:\ %1)=Could not export file '%0' (reason: %1) diff --git a/src/test/java/org/jabref/logic/importer/fileformat/InspecImporterTest.java b/src/test/java/org/jabref/logic/importer/fileformat/InspecImporterTest.java index e4abd486231..2b8b14d4ca1 100644 --- a/src/test/java/org/jabref/logic/importer/fileformat/InspecImporterTest.java +++ b/src/test/java/org/jabref/logic/importer/fileformat/InspecImporterTest.java @@ -118,9 +118,4 @@ public void getCLIId() { public void sGetExtensions() { assertEquals(StandardFileType.TXT, importer.getFileType()); } - - @Test - public void getDescription() { - assertEquals("INSPEC format importer.", importer.getDescription()); - } } diff --git a/src/test/java/org/jabref/logic/importer/fileformat/IsiImporterTest.java b/src/test/java/org/jabref/logic/importer/fileformat/IsiImporterTest.java index 29f86b5fed0..9c89d6178b7 100644 --- a/src/test/java/org/jabref/logic/importer/fileformat/IsiImporterTest.java +++ b/src/test/java/org/jabref/logic/importer/fileformat/IsiImporterTest.java @@ -60,12 +60,6 @@ public void sGetExtensions() { assertEquals(StandardFileType.ISI, importer.getFileType()); } - @Test - public void getDescription() { - assertEquals("Importer for the ISI Web of Science, INSPEC and Medline format.", - importer.getDescription()); - } - @ParameterizedTest @MethodSource("fileNames") public void isRecognizedFormatAccepted(String fileName) throws IOException { diff --git a/src/test/java/org/jabref/logic/importer/fileformat/MedlineImporterTest.java b/src/test/java/org/jabref/logic/importer/fileformat/MedlineImporterTest.java index 1e8a2562d88..a971a25bc83 100644 --- a/src/test/java/org/jabref/logic/importer/fileformat/MedlineImporterTest.java +++ b/src/test/java/org/jabref/logic/importer/fileformat/MedlineImporterTest.java @@ -40,9 +40,4 @@ public void getCLIId() { public void sGetExtensions() { assertEquals(StandardFileType.MEDLINE, importer.getFileType()); } - - @Test - public void getDescription() { - assertEquals("Importer for the Medline format.", importer.getDescription()); - } } diff --git a/src/test/java/org/jabref/logic/importer/fileformat/MedlinePlainImporterTest.java b/src/test/java/org/jabref/logic/importer/fileformat/MedlinePlainImporterTest.java index 7871ef805b1..e23df96ffe4 100644 --- a/src/test/java/org/jabref/logic/importer/fileformat/MedlinePlainImporterTest.java +++ b/src/test/java/org/jabref/logic/importer/fileformat/MedlinePlainImporterTest.java @@ -14,7 +14,6 @@ import org.jabref.logic.bibtex.BibEntryAssert; import org.jabref.logic.importer.ImportFormatPreferences; -import org.jabref.logic.util.StandardFileType; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.types.StandardEntryType; @@ -57,16 +56,6 @@ void setUp() { importer = new MedlinePlainImporter(importFormatPreferences); } - @Test - void sGetExtensions() { - assertEquals(StandardFileType.MEDLINE_PLAIN, importer.getFileType()); - } - - @Test - void getDescription() { - assertEquals("Importer for the MedlinePlain format.", importer.getDescription()); - } - @ParameterizedTest @MethodSource("fileNames") void isRecognizedFormat(String fileName) throws Exception { diff --git a/src/test/java/org/jabref/logic/importer/fileformat/MrDLibImporterTest.java b/src/test/java/org/jabref/logic/importer/fileformat/MrDLibImporterTest.java index 2a51be11490..0fb7dbd1fad 100644 --- a/src/test/java/org/jabref/logic/importer/fileformat/MrDLibImporterTest.java +++ b/src/test/java/org/jabref/logic/importer/fileformat/MrDLibImporterTest.java @@ -6,7 +6,6 @@ import java.util.List; import org.jabref.logic.importer.ParserResult; -import org.jabref.logic.util.StandardFileType; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; @@ -28,21 +27,6 @@ public void setUp() { input = new BufferedReader(new StringReader(testInput)); } - @Test - public void getDescription() { - assertEquals("Takes valid JSON documents from the Mr. DLib API and parses them into a BibEntry", importer.getDescription()); - } - - @Test - public void getName() { - assertEquals("MrDLibImporter", importer.getName()); - } - - @Test - public void getFileExtention() { - assertEquals(StandardFileType.JSON, importer.getFileType()); - } - @Test public void importDatabaseIsYearSetCorrectly() throws IOException { ParserResult parserResult = importer.importDatabase(input); diff --git a/src/test/java/org/jabref/logic/importer/fileformat/MsBibImporterTest.java b/src/test/java/org/jabref/logic/importer/fileformat/MsBibImporterTest.java index 0d53a2f60b9..143f0c1755e 100644 --- a/src/test/java/org/jabref/logic/importer/fileformat/MsBibImporterTest.java +++ b/src/test/java/org/jabref/logic/importer/fileformat/MsBibImporterTest.java @@ -7,7 +7,7 @@ import java.util.Collections; import java.util.List; -import org.jabref.logic.util.StandardFileType; +import org.jabref.logic.importer.Importer; import org.jabref.model.entry.BibEntry; import org.junit.jupiter.api.Test; @@ -17,54 +17,39 @@ public class MsBibImporterTest { - @Test - public void sGetExtensions() { - MsBibImporter importer = new MsBibImporter(); - assertEquals(StandardFileType.XML, importer.getFileType()); - } - - @Test - public void getDescription() { - MsBibImporter importer = new MsBibImporter(); - assertEquals("Importer for the MS Office 2007 XML bibliography format.", importer.getDescription()); - } + Importer importer = new MsBibImporter(); @Test public final void isNotRecognizedFormat() throws Exception { - MsBibImporter testImporter = new MsBibImporter(); List notAccepted = Arrays.asList("CopacImporterTest1.txt", "IsiImporterTest1.isi", "IsiImporterTestInspec.isi", "emptyFile.xml", "IsiImporterTestWOS.isi"); for (String s : notAccepted) { Path file = Path.of(MsBibImporter.class.getResource(s).toURI()); - assertFalse(testImporter.isRecognizedFormat(file)); + assertFalse(importer.isRecognizedFormat(file)); } } @Test public final void importEntriesEmpty() throws IOException, URISyntaxException { - MsBibImporter testImporter = new MsBibImporter(); Path file = Path.of(MsBibImporter.class.getResource("EmptyMsBib_Test.xml").toURI()); - List entries = testImporter.importDatabase(file).getDatabase().getEntries(); + List entries = importer.importDatabase(file).getDatabase().getEntries(); assertEquals(Collections.emptyList(), entries); } @Test public final void importEntriesNotRecognizedFormat() throws IOException, URISyntaxException { - MsBibImporter testImporter = new MsBibImporter(); Path file = Path.of(MsBibImporter.class.getResource("CopacImporterTest1.txt").toURI()); - List entries = testImporter.importDatabase(file).getDatabase().getEntries(); + List entries = importer.importDatabase(file).getDatabase().getEntries(); assertEquals(0, entries.size()); } @Test public final void getFormatName() { - MsBibImporter testImporter = new MsBibImporter(); - assertEquals("MSBib", testImporter.getName()); + assertEquals("MSBib", importer.getName()); } @Test public final void getCommandLineId() { - MsBibImporter testImporter = new MsBibImporter(); - assertEquals("msbib", testImporter.getId()); + assertEquals("msbib", importer.getId()); } } diff --git a/src/test/java/org/jabref/logic/importer/fileformat/OvidImporterTest.java b/src/test/java/org/jabref/logic/importer/fileformat/OvidImporterTest.java index 4b680c0d7a0..76593200034 100644 --- a/src/test/java/org/jabref/logic/importer/fileformat/OvidImporterTest.java +++ b/src/test/java/org/jabref/logic/importer/fileformat/OvidImporterTest.java @@ -11,13 +11,11 @@ import java.util.stream.Stream; import org.jabref.logic.bibtex.BibEntryAssert; -import org.jabref.logic.util.StandardFileType; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.field.UnknownField; import org.jabref.model.entry.types.StandardEntryType; -import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; @@ -28,7 +26,7 @@ public class OvidImporterTest { private static final String FILE_ENDING = ".txt"; - private OvidImporter importer; + private OvidImporter importer = new OvidImporter(); private static Stream fileNames() throws IOException { Predicate fileName = name -> name.startsWith("OvidImporterTest") @@ -42,31 +40,6 @@ private static Stream invalidFileNames() throws IOException { return ImporterTestEngine.getTestFiles(fileName).stream(); } - @BeforeEach - public void setUp() { - importer = new OvidImporter(); - } - - @Test - public void getFormatName() { - assertEquals("Ovid", importer.getName()); - } - - @Test - public void getCLIId() { - assertEquals("ovid", importer.getId()); - } - - @Test - public void sGetExtensions() { - assertEquals(StandardFileType.TXT, importer.getFileType()); - } - - @Test - public void getDescription() { - assertEquals("Imports an Ovid file.", importer.getDescription()); - } - @ParameterizedTest @MethodSource("fileNames") public void isRecognizedFormatAccept(String fileName) throws IOException, URISyntaxException { diff --git a/src/test/java/org/jabref/logic/importer/fileformat/PdfContentImporterTest.java b/src/test/java/org/jabref/logic/importer/fileformat/PdfContentImporterTest.java index cc5baf59824..83e6466f411 100644 --- a/src/test/java/org/jabref/logic/importer/fileformat/PdfContentImporterTest.java +++ b/src/test/java/org/jabref/logic/importer/fileformat/PdfContentImporterTest.java @@ -5,7 +5,6 @@ import java.util.List; import java.util.Optional; -import org.jabref.logic.util.StandardFileType; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.LinkedFile; import org.jabref.model.entry.field.StandardField; @@ -25,17 +24,6 @@ void setUp() { importer = new PdfContentImporter(); } - @Test - void sGetExtensions() { - assertEquals(StandardFileType.PDF, importer.getFileType()); - } - - @Test - void getDescription() { - assertEquals("PdfContentImporter parses data of the first page of the PDF and creates a BibTeX entry. Currently, Springer and IEEE formats are supported.", - importer.getDescription()); - } - @Test void doesNotHandleEncryptedPdfs() throws Exception { Path file = Path.of(PdfContentImporter.class.getResource("/pdfs/encrypted.pdf").toURI()); diff --git a/src/test/java/org/jabref/logic/importer/fileformat/PdfEmbeddedBibFileImporterTest.java b/src/test/java/org/jabref/logic/importer/fileformat/PdfEmbeddedBibFileImporterTest.java index e7433323f1c..82e79d10698 100644 --- a/src/test/java/org/jabref/logic/importer/fileformat/PdfEmbeddedBibFileImporterTest.java +++ b/src/test/java/org/jabref/logic/importer/fileformat/PdfEmbeddedBibFileImporterTest.java @@ -7,7 +7,6 @@ import javafx.collections.FXCollections; import org.jabref.logic.importer.ImportFormatPreferences; -import org.jabref.logic.util.StandardFileType; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.types.StandardEntryType; @@ -31,17 +30,6 @@ void setUp() { importer = new PdfEmbeddedBibFileImporter(importFormatPreferences); } - @Test - void sGetExtensions() { - assertEquals(StandardFileType.PDF, importer.getFileType()); - } - - @Test - void getDescription() { - assertEquals("PdfEmbeddedBibFileImporter imports an embedded Bib-File from the PDF.", - importer.getDescription()); - } - @Test void doesNotHandleEncryptedPdfs() throws Exception { Path file = Path.of(PdfEmbeddedBibFileImporter.class.getResource("/pdfs/encrypted.pdf").toURI()); diff --git a/src/test/java/org/jabref/logic/importer/fileformat/PdfMergeMetadataImporterTest.java b/src/test/java/org/jabref/logic/importer/fileformat/PdfMergeMetadataImporterTest.java index 7cc2e714bb3..6951e6bd64a 100644 --- a/src/test/java/org/jabref/logic/importer/fileformat/PdfMergeMetadataImporterTest.java +++ b/src/test/java/org/jabref/logic/importer/fileformat/PdfMergeMetadataImporterTest.java @@ -43,17 +43,6 @@ void setUp() { importer = new PdfMergeMetadataImporter(importFormatPreferences); } - @Test - void sGetExtensions() { - assertEquals(StandardFileType.PDF, importer.getFileType()); - } - - @Test - void getDescription() { - assertEquals("PdfMergeMetadataImporter imports metadata from a PDF using multiple strategies and merging the result.", - importer.getDescription()); - } - @Test void doesNotHandleEncryptedPdfs() throws Exception { Path file = Path.of(PdfMergeMetadataImporter.class.getResource("/pdfs/encrypted.pdf").toURI()); diff --git a/src/test/java/org/jabref/logic/importer/fileformat/PdfVerbatimBibTextImporterTest.java b/src/test/java/org/jabref/logic/importer/fileformat/PdfVerbatimBibTextImporterTest.java index 15fa9aabbda..a5ddb3ec89b 100644 --- a/src/test/java/org/jabref/logic/importer/fileformat/PdfVerbatimBibTextImporterTest.java +++ b/src/test/java/org/jabref/logic/importer/fileformat/PdfVerbatimBibTextImporterTest.java @@ -7,7 +7,6 @@ import javafx.collections.FXCollections; import org.jabref.logic.importer.ImportFormatPreferences; -import org.jabref.logic.util.StandardFileType; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.LinkedFile; import org.jabref.model.entry.field.StandardField; @@ -32,17 +31,6 @@ void setUp() { importer = new PdfVerbatimBibTextImporter(importFormatPreferences); } - @Test - void sGetExtensions() { - assertEquals(StandardFileType.PDF, importer.getFileType()); - } - - @Test - void getDescription() { - assertEquals("PdfVerbatimBibTextImporter imports a verbatim BibTeX entry from the first page of the PDF.", - importer.getDescription()); - } - @Test void doesNotHandleEncryptedPdfs() throws Exception { Path file = Path.of(PdfVerbatimBibTextImporter.class.getResource("/pdfs/encrypted.pdf").toURI()); diff --git a/src/test/java/org/jabref/logic/importer/fileformat/PdfXmpImporterTest.java b/src/test/java/org/jabref/logic/importer/fileformat/PdfXmpImporterTest.java index 2e097bd13eb..5ae13cce82a 100644 --- a/src/test/java/org/jabref/logic/importer/fileformat/PdfXmpImporterTest.java +++ b/src/test/java/org/jabref/logic/importer/fileformat/PdfXmpImporterTest.java @@ -9,7 +9,6 @@ import java.util.stream.Stream; import org.jabref.logic.importer.ParserResult; -import org.jabref.logic.util.StandardFileType; import org.jabref.logic.xmp.XmpPreferences; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; @@ -38,21 +37,6 @@ public void setUp() { importer = new PdfXmpImporter(mock(XmpPreferences.class)); } - @Test - public void getFormatName() { - assertEquals("XMP-annotated PDF", importer.getName()); - } - - @Test - public void sGetExtensions() { - assertEquals(StandardFileType.PDF, importer.getFileType()); - } - - @Test - public void getDescription() { - assertEquals("Wraps the XMPUtility function to be used as an Importer.", importer.getDescription()); - } - @Disabled("XMP reader prints warnings to the logger when parsing does not work") @Test public void importEncryptedFileReturnsError() throws URISyntaxException { diff --git a/src/test/java/org/jabref/logic/importer/fileformat/RISImporterTest.java b/src/test/java/org/jabref/logic/importer/fileformat/RISImporterTest.java index 4f29d20567a..7ec30c0ca81 100644 --- a/src/test/java/org/jabref/logic/importer/fileformat/RISImporterTest.java +++ b/src/test/java/org/jabref/logic/importer/fileformat/RISImporterTest.java @@ -4,42 +4,13 @@ import java.net.URISyntaxException; import java.nio.file.Path; -import org.jabref.logic.util.StandardFileType; - -import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; public class RISImporterTest { - private RisImporter importer; - - @BeforeEach - public void setUp() { - importer = new RisImporter(); - } - - @Test - public void getFormatName() { - assertEquals("RIS", importer.getName()); - } - - @Test - public void getCLIId() { - assertEquals("ris", importer.getId()); - } - - @Test - public void sGetExtensions() { - assertEquals(StandardFileType.RIS, importer.getFileType()); - } - - @Test - public void getDescription() { - assertEquals("Imports a Biblioscape Tag File.", importer.getDescription()); - } + private RisImporter importer = new RisImporter(); @Test public void ifNotRecognizedFormat() throws IOException, URISyntaxException { diff --git a/src/test/java/org/jabref/logic/importer/fileformat/RepecNepImporterTest.java b/src/test/java/org/jabref/logic/importer/fileformat/RepecNepImporterTest.java index 7768bbef2b2..8c09d43d142 100644 --- a/src/test/java/org/jabref/logic/importer/fileformat/RepecNepImporterTest.java +++ b/src/test/java/org/jabref/logic/importer/fileformat/RepecNepImporterTest.java @@ -5,15 +5,12 @@ import java.util.stream.Stream; import org.jabref.logic.importer.ImportFormatPreferences; -import org.jabref.logic.util.StandardFileType; import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; import org.mockito.Answers; -import static org.junit.jupiter.api.Assertions.assertEquals; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; @@ -59,25 +56,4 @@ public void isNotRecognizedFormat(String fileName) throws IOException { public void importEntries(String fileName) throws Exception { ImporterTestEngine.testImportEntries(testImporter, fileName, FILE_ENDING); } - - @Test - public final void getFormatName() { - assertEquals("REPEC New Economic Papers (NEP)", testImporter.getName()); - } - - @Test - public final void getCliId() { - assertEquals("repecnep", testImporter.getId()); - } - - @Test - public void getExtension() { - assertEquals(StandardFileType.TXT, testImporter.getFileType()); - } - - @Test - public final void getDescription() { - assertEquals("Imports a New Economics Papers-Message from the REPEC-NEP Service.", - testImporter.getDescription()); - } }