diff --git a/CHANGELOG.md b/CHANGELOG.md index 32c7ef06b39..013c8ee4518 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ Note that this project **does not** adhere to [Semantic Versioning](http://semve ### Added - We added support for searching ShortScience for an entry through the user's browser. [#6018](https://github.com/JabRef/jabref/pull/6018) +- We added tooltips for most fields in the entry editor containing a short description. [#5847](https://github.com/JabRef/jabref/issues/5847) ### Changed diff --git a/src/main/java/org/jabref/gui/fieldeditors/FieldNameLabel.java b/src/main/java/org/jabref/gui/fieldeditors/FieldNameLabel.java index f36eafbb808..91b48f52721 100644 --- a/src/main/java/org/jabref/gui/fieldeditors/FieldNameLabel.java +++ b/src/main/java/org/jabref/gui/fieldeditors/FieldNameLabel.java @@ -3,8 +3,13 @@ import javafx.geometry.Insets; import javafx.geometry.Pos; import javafx.scene.control.Label; +import javafx.scene.control.Tooltip; +import org.jabref.logic.l10n.Localization; import org.jabref.model.entry.field.Field; +import org.jabref.model.entry.field.InternalField; +import org.jabref.model.entry.field.StandardField; +import org.jabref.model.strings.StringUtil; public class FieldNameLabel extends Label { @@ -14,5 +19,143 @@ public FieldNameLabel(Field field) { setPadding(new Insets(4, 0, 0, 0)); setAlignment(Pos.CENTER); setPrefHeight(Double.POSITIVE_INFINITY); + + String description = getDescription(field); + if (StringUtil.isNotBlank(description)) { + Tooltip tooltip = new Tooltip(); + tooltip.setText(description); + this.setTooltip(tooltip); + } + } + + public String getDescription(Field field) { + if (field.isStandardField()) { + StandardField standardField = (StandardField) field; + switch (standardField) { + case ADDENDUM: + return Localization.lang("Miscellaneous bibliographic data usually printed at the end of the entry."); + case AFTERWORD: + return Localization.lang("Author(s) of an afterword to the work."); + case ANNOTATOR: + return Localization.lang("Author(s) of annotations to the work."); + case AUTHOR: + return Localization.lang("Author(s) of the work."); + case BOOKTITLE: + return Localization.lang("Title of the main publication this work is part of."); + case CHAPTER: + return Localization.lang("Chapter or section or any other unit of a work."); + case COMMENTATOR: + return Localization.lang("Author(s) of a commentary to the work.") + "\n" + + Localization.lang("Note that this field is intended for commented editions which have a commentator in addition to the author. If the work is a stand-alone commentary, the commentator should be given in the author field."); + case DATE: + return Localization.lang("Publication date of the work."); + case DOI: + return Localization.lang("Digital Object Identifier of the work."); + case EDITION: + return Localization.lang("Edition of a printed publication."); + case EDITOR: + return Localization.lang("Editor(s) of the work or the main publication, depending on the type of the entry."); + case EID: + return Localization.lang("Electronic identifier of a work.") + "\n" + + Localization.lang("This field may replace the pages field for journals deviating from the classic pagination scheme of printed journals by only enumerating articles or papers and not pages."); + case EPRINT: + return Localization.lang("Electronic identifier of an online publication.") + "\n" + + Localization.lang("This is roughly comparable to a DOI but specific to a certain archive, repository, service, or system."); + case EPRINTCLASS: + case PRIMARYCLASS: + return Localization.lang("Additional information related to the resource indicated by the eprint field.") + "\n" + + Localization.lang("This could be a section of an archive, a path indicating a service, a classification of some sort."); + case EPRINTTYPE: + case ARCHIVEPREFIX: + return Localization.lang("Type of the eprint identifier, e. g., the name of the archive, repository, service, or system the eprint field refers to."); + case EVENTDATE: + return Localization.lang("Date of a conference, a symposium, or some other event."); + case EVENTTITLE: + return Localization.lang("Title of a conference, a symposium, or some other event.") + "\n" + + Localization.lang("Note that this field holds the plain title of the event. Things like \"Proceedings of the Fifth XYZ Conference\" go into the titleaddon or booktitleaddon field."); + case EVENTTITLEADDON: + return Localization.lang("Annex to the eventtitle field.") + "\n" + + Localization.lang("Can be used for known event acronyms."); + case FILE: + case PDF: + return Localization.lang("Link(s) to a local PDF or other document of the work."); + case HOWPUBLISHED: + return Localization.lang("Publication notice for unusual publications which do not fit into any of the common categories."); + case INSTITUTION: + case SCHOOL: + return Localization.lang("Name of a university or some other institution."); + case INTRODUCTION: + return Localization.lang("Author(s) of an introduction to the work."); + case ISBN: + return Localization.lang("International Standard Book Number of a book."); + case ISSUE: + return Localization.lang("Issue of a journal.") + "\n" + + Localization.lang("This field is intended for journals whose individual issues are identified by a designation such as \"Spring\" or \"Summer\" rather than the month or a number. Integer ranges and short designators are better written to the number field."); + case ISSUESUBTITLE: + return Localization.lang("Subtitle of a specific issue of a journal or other periodical."); + case ISSUETITLE: + return Localization.lang("Title of a specific issue of a journal or other periodical."); + case JOURNALTITLE: + case JOURNAL: + return Localization.lang("Name of a journal, a newspaper, or some other periodical."); + case LABEL: + return Localization.lang("Designation to be used by the citation style as a substitute for the regular label if any data required to generate the regular label is missing."); + case LIBRARY: + return Localization.lang("Information such as a library name and a call number."); + case LOCATION: + case ADDRESS: + return Localization.lang("The place(s) of publication, i. e., the location of the publisher or institution, depending on the entry type."); + case MAINTITLE: + return Localization.lang("Main title of a multi-volume book, such as \"Collected Works\"."); + case MONTH: + return Localization.lang("Publication month."); + case NOTE: + return Localization.lang("Miscellaneous bibliographic data which does not fit into any other field."); + case NUMBER: + return Localization.lang("Number of a journal or the volume/number of a book in a series."); + case ORGANIZATION: + return Localization.lang("Organization(s) that published a manual or an online resource, or sponsored a conference."); + case PAGES: + return Localization.lang("One or more page numbers or page ranges.") + "\n" + + Localization.lang("If the work is published as part of another one, such as an article in a journal or a collection, this field holds the relevant page range in that other work. It may also be used to limit the reference to a specific part of a work (a chapter in a book, for example). For papers in electronic journals with anon-classical pagination setup the eid field may be more suitable."); + case PAGETOTAL: + return Localization.lang("Total number of pages of the work."); + case PUBLISHER: + return Localization.lang("Name(s) of the publisher(s)."); + case PUBSTATE: + return Localization.lang("Publication state of the work, e. g., \"in press\"."); + case SERIES: + return Localization.lang("Name of a publication series, such as \"Studies in...\", or the number of a journal series."); + case SUBTITLE: + return Localization.lang("Subtitle of the work."); + case TITLE: + return Localization.lang("Title of the work."); + case URL: + return Localization.lang("URL of an online publication."); + case URLDATE: + return Localization.lang("Access date of the address specified in the url field."); + case VENUE: + return Localization.lang("Location of a conference, a symposium, or some other event."); + case VERSION: + return Localization.lang("Revision number of a piece of software, a manual, etc."); + case VOLUME: + return Localization.lang("Volume of a multi-volume book or a periodical."); + case VOLUMES: + return Localization.lang("Total number of volumes of a multi-volume work."); + case YEAR: + return Localization.lang("Year of publication."); + case KEYWORDS: + return Localization.lang("Separated list of keywords."); + } + } else if (field instanceof InternalField) { + InternalField internalField = (InternalField) field; + switch (internalField) { + case KEY_FIELD: + return Localization.lang("Key by which the work may be cited."); + case GROUPS: + return Localization.lang("Name(s) of the (manual) groups the entry belongs to."); + } + } + return ""; } } diff --git a/src/main/java/org/jabref/model/entry/field/StandardField.java b/src/main/java/org/jabref/model/entry/field/StandardField.java index 6fe1b1e5a8f..6f10d4e0c57 100644 --- a/src/main/java/org/jabref/model/entry/field/StandardField.java +++ b/src/main/java/org/jabref/model/entry/field/StandardField.java @@ -72,6 +72,8 @@ public enum StandardField implements Field { KEY("key"), KEYWORDS("keywords"), LANGUAGE("language", FieldProperty.LANGUAGE), + LABEL("label"), + LIBRARY("library"), LOCATION("location"), MAINSUBTITLE("mainsubtitle", FieldProperty.BOOK_NAME), MAINTITLE("maintitle", FieldProperty.BOOK_NAME), diff --git a/src/main/resources/l10n/JabRef_en.properties b/src/main/resources/l10n/JabRef_en.properties index 3915f9ca525..04daaace2f5 100644 --- a/src/main/resources/l10n/JabRef_en.properties +++ b/src/main/resources/l10n/JabRef_en.properties @@ -2100,7 +2100,6 @@ Required\ and\ optional\ fields=Required and optional fields Index=Index Remove\ entry\ type=Remove entry type Remove\ field\ %0\ from\ currently\ selected\ entry\ type=Remove field %0 from currently selected entry type - Optional=Optional Required=Required Entry\ type\ cannot\ be\ empty.\ Please\ enter\ a\ name.=Entry type cannot be empty. Please enter a name. @@ -2111,5 +2110,64 @@ Unable\ to\ open\ ShortScience.=Unable to open ShortScience. Shared\ database=Shared database Lookup=Lookup - +Access\ date\ of\ the\ address\ specified\ in\ the\ url\ field.=Access date of the address specified in the url field. +Additional\ information\ related\ to\ the\ resource\ indicated\ by\ the\ eprint\ field.=Additional information related to the resource indicated by the eprint field. +Annex\ to\ the\ eventtitle\ field.=Annex to the eventtitle field. +Author(s)\ of\ a\ commentary\ to\ the\ work.=Author(s) of a commentary to the work. +Author(s)\ of\ an\ afterword\ to\ the\ work.=Author(s) of an afterword to the work. +Author(s)\ of\ an\ introduction\ to\ the\ work.=Author(s) of an introduction to the work. +Author(s)\ of\ annotations\ to\ the\ work.=Author(s) of annotations to the work. +Author(s)\ of\ the\ work.=Author(s) of the work. +Can\ be\ used\ for\ known\ event\ acronyms.=Can be used for known event acronyms. +Chapter\ or\ section\ or\ any\ other\ unit\ of\ a\ work.=Chapter or section or any other unit of a work. +Date\ of\ a\ conference,\ a\ symposium,\ or\ some\ other\ event.=Date of a conference, a symposium, or some other event. +Designation\ to\ be\ used\ by\ the\ citation\ style\ as\ a\ substitute\ for\ the\ regular\ label\ if\ any\ data\ required\ to\ generate\ the\ regular\ label\ is\ missing.=Designation to be used by the citation style as a substitute for the regular label if any data required to generate the regular label is missing. +Digital\ Object\ Identifier\ of\ the\ work.=Digital Object Identifier of the work. +Edition\ of\ a\ printed\ publication.=Edition of a printed publication. +Editor(s)\ of\ the\ work\ or\ the\ main\ publication,\ depending\ on\ the\ type\ of\ the\ entry.=Editor(s) of the work or the main publication, depending on the type of the entry. +Electronic\ identifier\ of\ a\ work.=Electronic identifier of a work. +Electronic\ identifier\ of\ an\ online\ publication.=Electronic identifier of an online publication. +If\ the\ work\ is\ published\ as\ part\ of\ another\ one,\ such\ as\ an\ article\ in\ a\ journal\ or\ a\ collection,\ this\ field\ holds\ the\ relevant\ page\ range\ in\ that\ other\ work.\ It\ may\ also\ be\ used\ to\ limit\ the\ reference\ to\ a\ specific\ part\ of\ a\ work\ (a\ chapter\ in\ a\ book,\ for\ example).\ For\ papers\ in\ electronic\ journals\ with\ anon-classical\ pagination\ setup\ the\ eid\ field\ may\ be\ more\ suitable.=If the work is published as part of another one, such as an article in a journal or a collection, this field holds the relevant page range in that other work. It may also be used to limit the reference to a specific part of a work (a chapter in a book, for example). For papers in electronic journals with anon-classical pagination setup the eid field may be more suitable. +Information\ such\ as\ a\ library\ name\ and\ a\ call\ number.=Information such as a library name and a call number. +International\ Standard\ Book\ Number\ of\ a\ book.=International Standard Book Number of a book. +Issue\ of\ a\ journal.=Issue of a journal. +Key\ by\ which\ the\ work\ may\ be\ cited.=Key by which the work may be cited. +Link(s)\ to\ a\ local\ PDF\ or\ other\ document\ of\ the\ work.=Link(s) to a local PDF or other document of the work. +Location\ of\ a\ conference,\ a\ symposium,\ or\ some\ other\ event.=Location of a conference, a symposium, or some other event. +Main\ title\ of\ a\ multi-volume\ book,\ such\ as\ "Collected\ Works".=Main title of a multi-volume book, such as "Collected Works". +Miscellaneous\ bibliographic\ data\ usually\ printed\ at\ the\ end\ of\ the\ entry.=Miscellaneous bibliographic data usually printed at the end of the entry. +Miscellaneous\ bibliographic\ data\ which\ does\ not\ fit\ into\ any\ other\ field.=Miscellaneous bibliographic data which does not fit into any other field. +Name(s)\ of\ the\ (manual)\ groups\ the\ entry\ belongs\ to.=Name(s) of the (manual) groups the entry belongs to. +Name(s)\ of\ the\ publisher(s).=Name(s) of the publisher(s). +Name\ of\ a\ journal,\ a\ newspaper,\ or\ some\ other\ periodical.=Name of a journal, a newspaper, or some other periodical. +Name\ of\ a\ publication\ series,\ such\ as\ "Studies\ in...",\ or\ the\ number\ of\ a\ journal\ series.=Name of a publication series, such as "Studies in...", or the number of a journal series. +Name\ of\ a\ university\ or\ some\ other\ institution.=Name of a university or some other institution. +Note\ that\ this\ field\ holds\ the\ plain\ title\ of\ the\ event.\ Things\ like\ "Proceedings\ of\ the\ Fifth\ XYZ\ Conference"\ go\ into\ the\ titleaddon\ or\ booktitleaddon\ field.=Note that this field holds the plain title of the event. Things like "Proceedings of the Fifth XYZ Conference" go into the titleaddon or booktitleaddon field. +Note\ that\ this\ field\ is\ intended\ for\ commented\ editions\ which\ have\ a\ commentator\ in\ addition\ to\ the\ author.\ If\ the\ work\ is\ a\ stand-alone\ commentary,\ the\ commentator\ should\ be\ given\ in\ the\ author\ field.=Note that this field is intended for commented editions which have a commentator in addition to the author. If the work is a stand-alone commentary, the commentator should be given in the author field. +Number\ of\ a\ journal\ or\ the\ volume/number\ of\ a\ book\ in\ a\ series.=Number of a journal or the volume/number of a book in a series. +One\ or\ more\ page\ numbers\ or\ page\ ranges.=One or more page numbers or page ranges. +Organization(s)\ that\ published\ a\ manual\ or\ an\ online\ resource,\ or\ sponsored\ a\ conference.=Organization(s) that published a manual or an online resource, or sponsored a conference. +Publication\ date\ of\ the\ work.=Publication date of the work. +Publication\ month.=Publication month. +Publication\ notice\ for\ unusual\ publications\ which\ do\ not\ fit\ into\ any\ of\ the\ common\ categories.=Publication notice for unusual publications which do not fit into any of the common categories. +Publication\ state\ of\ the\ work,\ e.\ g.,\ "in\ press".=Publication state of the work, e. g., "in press". +Revision\ number\ of\ a\ piece\ of\ software,\ a\ manual,\ etc.=Revision number of a piece of software, a manual, etc. +Separated\ list\ of\ keywords.=Separated list of keywords. +Subtitle\ of\ a\ specific\ issue\ of\ a\ journal\ or\ other\ periodical.=Subtitle of a specific issue of a journal or other periodical. +Subtitle\ of\ the\ work.=Subtitle of the work. +The\ place(s)\ of\ publication,\ i.\ e.,\ the\ location\ of\ the\ publisher\ or\ institution,\ depending\ on\ the\ entry\ type.=The place(s) of publication, i. e., the location of the publisher or institution, depending on the entry type. +This\ could\ be\ a\ section\ of\ an\ archive,\ a\ path\ indicating\ a\ service,\ a\ classification\ of\ some\ sort.=This could be a section of an archive, a path indicating a service, a classification of some sort. +This\ field\ is\ intended\ for\ journals\ whose\ individual\ issues\ are\ identified\ by\ a\ designation\ such\ as\ "Spring"\ or\ "Summer"\ rather\ than\ the\ month\ or\ a\ number.\ Integer\ ranges\ and\ short\ designators\ are\ better\ written\ to\ the\ number\ field.=This field is intended for journals whose individual issues are identified by a designation such as "Spring" or "Summer" rather than the month or a number. Integer ranges and short designators are better written to the number field. +This\ field\ may\ replace\ the\ pages\ field\ for\ journals\ deviating\ from\ the\ classic\ pagination\ scheme\ of\ printed\ journals\ by\ only\ enumerating\ articles\ or\ papers\ and\ not\ pages.=This field may replace the pages field for journals deviating from the classic pagination scheme of printed journals by only enumerating articles or papers and not pages. +This\ is\ roughly\ comparable\ to\ a\ DOI\ but\ specific\ to\ a\ certain\ archive,\ repository,\ service,\ or\ system.=This is roughly comparable to a DOI but specific to a certain archive, repository, service, or system. +Title\ of\ a\ conference,\ a\ symposium,\ or\ some\ other\ event.=Title of a conference, a symposium, or some other event. +Title\ of\ a\ specific\ issue\ of\ a\ journal\ or\ other\ periodical.=Title of a specific issue of a journal or other periodical. +Title\ of\ the\ main\ publication\ this\ work\ is\ part\ of.=Title of the main publication this work is part of. +Title\ of\ the\ work.=Title of the work. +Total\ number\ of\ pages\ of\ the\ work.=Total number of pages of the work. +Total\ number\ of\ volumes\ of\ a\ multi-volume\ work.=Total number of volumes of a multi-volume work. +Type\ of\ the\ eprint\ identifier,\ e.\ g.,\ the\ name\ of\ the\ archive,\ repository,\ service,\ or\ system\ the\ eprint\ field\ refers\ to.=Type of the eprint identifier, e. g., the name of the archive, repository, service, or system the eprint field refers to. +URL\ of\ an\ online\ publication.=URL of an online publication. +Volume\ of\ a\ multi-volume\ book\ or\ a\ periodical.=Volume of a multi-volume book or a periodical. +Year\ of\ publication.=Year of publication. Remove\ formatter\ %0=Remove formatter %0