Skip to content
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

Added support for (biblatex) langid to be an optional field in entry editor #12071

Merged
merged 20 commits into from
Dec 2, 2024

Conversation

mag-sun
Copy link
Contributor

@mag-sun mag-sun commented Oct 24, 2024

Overview:

Integrated 'langid' into all biblatex/bibtex supported entry types as an optional field. This is so formatting of entries can be adapted to the language of the entries. Closes #10868.

Changes implemented:

  • Added a 'Langid' enum class defining all valid language ids provided by the biblatex documentation ([https://au.mirrors.cicku.me/ctan/macros/latex/contrib/biblatex/doc/biblatex.pdf]).
  • Added a 'LanguageEditorViewModel' class to handle the gui and dropdown menu.
  • Introduced 'langid' as an important field in all relevant biblatex entry type definitions.
langid.video.mp4

image

Mandatory checks

  • I own the copyright of the code submitted and I licence it under the MIT license
  • Change in CHANGELOG.md described in a way that is understandable for the average user (if applicable)
  • Tests created for changes (if applicable)
  • Manually tested changed features in running JabRef (always required)
  • Screenshots added in PR description (for UI changes)
  • Checked developer's documentation: Is the information available and up to date? If not, I outlined it in this pull request.
  • Checked documentation: Is the information available and up to date? If not, I created an issue at https://github.com/JabRef/user-documentation/issues or, even better, I submitted a pull request to the documentation repository.

Copy link
Member

@koppor koppor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Initial comments.

Please re-iterate on the biblatex smanual and check whether language and origLanguage also have the same values. If yes, your editor can be used if the field proprty FieldProperty.LANGUAGE langauge is present. If not, then this property can just be remoed.

In other words FieldPropety groups fields together and indicates the editor for it. Do not introduce a property if it used for one field only.

CHANGELOG.md Outdated Show resolved Hide resolved
gradle.properties Outdated Show resolved Hide resolved
src/main/java/org/jabref/logic/msbib/MSBibEntry.java Outdated Show resolved Hide resolved
src/test/java/org/jabref/model/entry/LangidTest.java Outdated Show resolved Hide resolved
src/test/java/org/jabref/model/entry/LangidTest.java Outdated Show resolved Hide resolved
- removed redundant description in CHANGELOG.md
- removed unnecessary gradle properties
- removed unnecessary tests
- fixed formatting/commented out code
gradle.properties Outdated Show resolved Hide resolved
Copy link
Member

@koppor koppor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests are a bit too verbose and not confirming to the one-assertion-per-test rule. Please streamline.

Other comments inside.

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your code currently does not meet JabRef's code guidelines.
We use Checkstyle to identify issues.
The tool reviewdog already placed comments on GitHub to indicate the places. See the tab "Files" in you PR.
Please carefully follow the setup guide for the codestyle.
Afterwards, please run checkstyle locally and fix the issues.

You can check review dog's comments at the tab "Files changed" of your pull request.

…ing:

- refactored and renamed LangidEditorViewModel.java to LanguageEditorViewModel (and tests)
- re-added gradle property
- reverted edits to BibtexEntryTypeDefinitions.java
- removed FieldProperty.LANGUAGEID so both language and langid standard fields have FieldProperty.LANGUAGE
NB: Still yet to fix tests
…into 10868-support-for-langid-field

# Conflicts:
#	gradle.properties
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your code currently does not meet JabRef's code guidelines.
We use Checkstyle to identify issues.
The tool reviewdog already placed comments on GitHub to indicate the places. See the tab "Files" in you PR.
Please carefully follow the setup guide for the codestyle.
Afterwards, please run checkstyle locally and fix the issues.

You can check review dog's comments at the tab "Files changed" of your pull request.

koppor
koppor previously requested changes Oct 27, 2024
Copy link
Member

@koppor koppor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor comments.

Tests have to be rewritten to fit JabRef style.

No text for failing assertions.

@koppor koppor added the status: changes required Pull requests that are not yet complete label Oct 31, 2024
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your code currently does not meet JabRef's code guidelines.
We use Checkstyle to identify issues.
Please carefully follow the setup guide for the codestyle.
Afterwards, please run checkstyle locally and fix the issues.

@Siedlerchr Siedlerchr marked this pull request as ready for review December 1, 2024 16:05
@Siedlerchr Siedlerchr added status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers and removed status: changes required Pull requests that are not yet complete labels Dec 1, 2024
Siedlerchr
Siedlerchr previously approved these changes Dec 1, 2024
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your code currently does not meet JabRef's code guidelines.
We use Checkstyle to identify issues.
Please carefully follow the setup guide for the codestyle.
Afterwards, please run checkstyle locally and fix the issues.

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your code currently does not meet JabRef's code guidelines.
We use OpenRewrite to ensure "modern" Java coding practices.
The issues found can be automatically fixed.
Please execute the gradle task rewriteRun, check the results, commit, and push.

You can check the detailed error output by navigating to your pull request, selecting the tab "Checks", section "Tests" (on the left), subsection "OpenRewrite".

Siedlerchr
Siedlerchr previously approved these changes Dec 1, 2024
@Siedlerchr Siedlerchr enabled auto-merge December 1, 2024 17:17
@Siedlerchr Siedlerchr added this pull request to the merge queue Dec 2, 2024
Merged via the queue into JabRef:main with commit d9b38ce Dec 2, 2024
23 checks passed
Siedlerchr added a commit that referenced this pull request Dec 6, 2024
* upstream/main:
  New Crowdin updates (#12264)
  New Crowdin updates (#12263)
  11219 adapt UI font size (#12042)
  Added support for (biblatex) `langid` to be an optional field in entry editor (#12071)
  improve unlinked files dialog (#12195)
  Reword 0034-use-citation-key-for-grouping-chat-messages.md (#12183)
  Bump dev.langchain4j:langchain4j-open-ai from 0.36.0 to 0.36.2 (#12259)
  Bump io.zonky.test.postgres:embedded-postgres-binaries-bom (#12258)
  Bump tech.units:indriya from 2.2 to 2.2.1 (#12257)
  Bump org.jetbrains.kotlin:kotlin-stdlib-jdk8 from 2.0.21 to 2.1.0 (#12256)
  Bump io.github.classgraph:classgraph from 4.8.177 to 4.8.179 (#12255)
  Bump src/main/resources/csl-styles from `b90b81a` to `6b7b611` (#12254)
  Add hints on research (and BibTeX) to README.md (#12253)
  Disable non-working Openrewrite recipe
  always set maximized  to false on exit for mac (#12248)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for (biblatex) langid field in entry editor
3 participants