-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Year/date format suggestion #2186
Conversation
The idea is good. Shouldn't the Further date/time rework is discussed at JabRef#130. Suggestion: you could elaborate a bit in the PR description. If one reads the notifications via mail, one cannot directly see the diff and get the idea. |
I'm not sure, but |
Please set label "ready-for-review". Thanks. |
prompt = String.format("YYYY-MM-DD"); | ||
} | ||
if (field.equals(FieldName.URL)) { | ||
prompt = String.format("http://"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better suggest https://
Tested locally and looks good! It is also interesting to see that we have not quite listed all BibLaTeX fields. Very minor issue: Could you add a changelog entry? After all something visible has changed (New suggestions in certain fields in the entry editor). Then I would merge. |
Could you also check the biblatex mode? editora, editorb, editorc, translator, ...? |
@koppor What exactly do you mean? Those fields (except URL) are only visible in the entry editor in biblatex mode anyway. |
Everything ok with editora, editorb... It only makes sense to define a field name constant for this fields, if you want to use the constant somewhere else in the code. |
@grimes2 @koppor Excellent hint! And also something additional to do in this PR! Please have a look at |
The replacement looks good! Now, one more refactoring (and apologies for all the requests). After looking at the code a second time, I think @koppor is correct in that this should be Thanks for your patience with our requests, we are just trying to get the best quality code :-) |
why not just After @lenhard's comments are implemented 👍 for merge. |
@tobiasdiez Because switches are ugly and if-elseifs are beautiful :-P Let us leave that open for @grimes2 |
prompt = String.format("%1$s and %1$s and others", Localization.lang("Firstname Lastname")); | ||
break; | ||
case FieldName.EDITOR: | ||
prompt = String.format("%1$s andk %1$s and others", Localization.lang("Firstname Lastname")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is the "k" after and a typo?
Code looks good to me! @lenhard Switches are compiled to more efficient bytecode and instead of chained if/else ifs they are actually better readable: |
The general form of the ISSN code is NNNN-NNNC (Wikipedia). Should I add this form as a suggestion to the ISSN field? |
I think a Suggestion for ISSN is not necessary - there is only one existing Format. And if you search for the ISSN of Journal it should be found in this format. |
@Siedlerchr: Switches are the source of many infamous switch-fall-through bugs (Apple's certificate validation system for example, if I remember it correctly), which is why I try to avoid them. To me, a potential increase in maintainability beats a potential improvement in performance any day. But anyway, there is not really a point in arguing about this. To me the current solution is fine and I am merging it now. @grimes2 Thank you very much for your contribution! |
@bartsch-dev refactors the suggestion switch in EntryEditorTab (#2199). He can easily add further cases. In DOI field is the DOI-Resolver |
Year/date format suggestion. The change adds a greyed-out suggestion for the recommended format of the field. Example: for the date field the format should be yyyy-mm-dd.
gradle localizationUpdate
?