From 3b72050f4549c239e03b82f5b1f411de925a0e4a Mon Sep 17 00:00:00 2001 From: morganteg Date: Thu, 27 Apr 2023 22:10:25 +0200 Subject: [PATCH] Fixes #9372 Change default File Chooser to show supported files extensions --- src/main/java/org/jabref/gui/util/FileFilterConverter.java | 6 +++++- src/main/resources/l10n/JabRef_en.properties | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/jabref/gui/util/FileFilterConverter.java b/src/main/java/org/jabref/gui/util/FileFilterConverter.java index 3f51bf534eea..a826085e3520 100644 --- a/src/main/java/org/jabref/gui/util/FileFilterConverter.java +++ b/src/main/java/org/jabref/gui/util/FileFilterConverter.java @@ -27,7 +27,11 @@ private FileFilterConverter() { } public static FileChooser.ExtensionFilter toExtensionFilter(FileType fileType) { - String description = Localization.lang("%0 file", fileType.toString()); + String description = Localization.lang( + "%0 file (%1)", + fileType.getName(), + String.join(", ", fileType.getExtensionsWithAsteriskAndDot()) + ); return new FileChooser.ExtensionFilter(description, fileType.getExtensionsWithAsteriskAndDot()); } diff --git a/src/main/resources/l10n/JabRef_en.properties b/src/main/resources/l10n/JabRef_en.properties index 188a114e8d4d..8a955defa7af 100644 --- a/src/main/resources/l10n/JabRef_en.properties +++ b/src/main/resources/l10n/JabRef_en.properties @@ -1725,6 +1725,7 @@ Cannot\ cite\ entries\ without\ citation\ keys.\ Generate\ keys\ now?=Cannot cit New\ technical\ report=New technical report %0\ file=%0 file +%0\ file\ (%1)=%0 file (%1) Custom\ layout\ file=Custom layout file Protected\ terms\ file=Protected terms file Style\ file=Style file