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

Remove "Match category" from localization #11626

Merged
merged 3 commits into from
Aug 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -145,14 +145,15 @@ public static void setExactWidth(TableColumn<?, ?> column, double width) {
column.setMaxWidth(width);
}

/**
* Creates a column for the match category.
* <p>This column is always hidden but is used for sorting the table
* in the floating mode. The order of the {@link MatchCategory} enum constants
* determines the sorting order.</p>
*/
private TableColumn<BibEntryTableViewModel, MatchCategory> createMatchCategoryColumn(MainTableColumnModel columnModel) {
TableColumn<BibEntryTableViewModel, MatchCategory> column = new MainTableColumn<>(columnModel);
Node header = new Text(Localization.lang("Match category"));
header.getStyleClass().add("mainTable-header");
Tooltip.install(header, new Tooltip(MainTableColumnModel.Type.MATCH_CATEGORY.getDisplayName()));
column.setGraphic(header);
column.setCellValueFactory(cellData -> cellData.getValue().matchCategory());
new ValueTableCellFactory<BibEntryTableViewModel, MatchCategory>().withText(String::valueOf).install(column);
column.setSortable(true);
column.setSortType(TableColumn.SortType.ASCENDING);
column.setVisible(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public class MainTableColumnModel {

private static final Logger LOGGER = LoggerFactory.getLogger(MainTableColumnModel.class);
public enum Type {
MATCH_CATEGORY("match_category", Localization.lang("Match category")),
MATCH_CATEGORY("match_category"), // Not localized, because this column is always hidden
INDEX("index", Localization.lang("Index")),
EXTRAFILE("extrafile", Localization.lang("File type")),
FILES("files", Localization.lang("Linked files")),
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/org/jabref/gui/search/MatchCategory.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package org.jabref.gui.search;

/**
* @implNote The order of constants in this enum is important because it is used for sorting the main table.
*/
public enum MatchCategory {
MATCHING_SEARCH_AND_GROUPS,
MATCHING_SEARCH_NOT_GROUPS,
Expand Down
1 change: 0 additions & 1 deletion src/main/resources/l10n/JabRef_en.properties
Original file line number Diff line number Diff line change
Expand Up @@ -823,7 +823,6 @@ Character\ encoding\ '%0'\ is\ not\ supported.=Character encoding '%0' is not su
Filter\ search\ results=Filter search results
Filter\ by\ groups=Filter by groups
Invert\ groups=Invert groups
Match\ category=Match category
Scroll\ to\ previous\ match\ category=Scroll to previous match category
Scroll\ to\ next\ match\ category=Scroll to next match category
Search=Search
Expand Down