From 5bc359fa5f572c40ac3f05551e5eecd8126845d8 Mon Sep 17 00:00:00 2001 From: Oliver Kopp Date: Tue, 2 May 2023 09:30:49 +0200 Subject: [PATCH] Fix split multiline localization (#9814) --- .gitignore | 2 ++ .../gui/externalfiles/DownloadFullTextAction.java | 2 +- .../linkedfiles/LinkedFilesTabViewModel.java | 13 +++---------- .../org/jabref/preferences/JabRefPreferences.java | 2 +- src/main/resources/l10n/JabRef_en.properties | 12 ++++++------ 5 files changed, 13 insertions(+), 18 deletions(-) diff --git a/.gitignore b/.gitignore index f2a7cad5e5e..5b709f65ea7 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,8 @@ src/main/gen/ src/main/generated/ src-gen/ +structure101-settings.java.hsw + # private data /buildres/jabref-cert-2016.p12 diff --git a/src/main/java/org/jabref/gui/externalfiles/DownloadFullTextAction.java b/src/main/java/org/jabref/gui/externalfiles/DownloadFullTextAction.java index be8b74ede44..df950b7e893 100644 --- a/src/main/java/org/jabref/gui/externalfiles/DownloadFullTextAction.java +++ b/src/main/java/org/jabref/gui/externalfiles/DownloadFullTextAction.java @@ -113,7 +113,7 @@ private void downloadFullTexts(Map> downloads, BibDataba Optional dir = databaseContext.getFirstExistingFileDir(preferences.getFilePreferences()); if (dir.isEmpty()) { dialogService.showErrorDialogAndWait(Localization.lang("Directory not found"), - Localization.lang("Main file directory not set. Check the preferences (linked files) or the library properties.")); + Localization.lang("Main file directory not set. Check the preferences (\"Linked files\") or modify the library properties (\"Override default file directories\").")); return; } diff --git a/src/main/java/org/jabref/gui/preferences/linkedfiles/LinkedFilesTabViewModel.java b/src/main/java/org/jabref/gui/preferences/linkedfiles/LinkedFilesTabViewModel.java index 6acc9830346..d020b267179 100644 --- a/src/main/java/org/jabref/gui/preferences/linkedfiles/LinkedFilesTabViewModel.java +++ b/src/main/java/org/jabref/gui/preferences/linkedfiles/LinkedFilesTabViewModel.java @@ -54,16 +54,9 @@ public LinkedFilesTabViewModel(DialogService dialogService, PreferencesService p mainFileDirValidator = new FunctionBasedValidator<>( mainFileDirectoryProperty, mainDirectoryPath -> { - ValidationMessage error = ValidationMessage.error(String.format( - "%s%n%s%n%n%s%n%n%s > %s > %s", - Localization.lang("Main directory not found"), - mainDirectoryPath, - Localization.lang("Please select a valid main directory under"), - Localization.lang("Linked files"), - Localization.lang("File directory"), - Localization.lang("Main file directory") - )); - + ValidationMessage error = ValidationMessage.error( + Localization.lang("Main file directory '%0' not found.\nCheck the tab \"Linked files\".", mainDirectoryPath) + ); try { Path path = Path.of(mainDirectoryPath); if (!(Files.exists(path) && Files.isDirectory(path))) { diff --git a/src/main/java/org/jabref/preferences/JabRefPreferences.java b/src/main/java/org/jabref/preferences/JabRefPreferences.java index 1763fe4a2ac..dcf13a8cdfb 100644 --- a/src/main/java/org/jabref/preferences/JabRefPreferences.java +++ b/src/main/java/org/jabref/preferences/JabRefPreferences.java @@ -128,7 +128,7 @@ * Internally it defines symbols used to pick a value from the {@code java.util.prefs} interface and keeps a hashmap * with all the default values. *

- * There are still some similar preferences classes (OpenOfficePreferences and SharedDatabasePreferences) which also use + * There are still some similar preferences classes ({@link org.jabref.logic.openoffice.OpenOfficePreferences} and {@link org.jabref.logic.shared.prefs.SharedDatabasePreferences}) which also use * the {@code java.util.prefs} API. */ public class JabRefPreferences implements PreferencesService { diff --git a/src/main/resources/l10n/JabRef_en.properties b/src/main/resources/l10n/JabRef_en.properties index 504c0fba0b2..fe7284df124 100644 --- a/src/main/resources/l10n/JabRef_en.properties +++ b/src/main/resources/l10n/JabRef_en.properties @@ -507,8 +507,6 @@ Load\ and\ Save\ preferences\ from/to\ jabref.xml\ on\ start-up\ (memory\ stick\ Show\ advanced\ hints\ (i.e.\ helpful\ tooltips,\ suggestions\ and\ explanation)=Show advanced hints (i.e. helpful tooltips, suggestions and explanation) -Main\ file\ directory=Main file directory - Manage\ custom\ exports=Manage custom exports Manage\ custom\ imports=Manage custom imports @@ -1506,7 +1504,11 @@ Does\ nothing.=Does nothing. Identity=Identity Clears\ the\ field\ completely.=Clears the field completely. Directory\ not\ found=Directory not found -Main\ file\ directory\ not\ set.\ Check\ the\ preferences\ (linked\ files)\ or\ the\ library\ properties.=Main file directory not set. Check the preferences (linked files) or the library properties. + +Main\ file\ directory=Main file directory +Main\ file\ directory\ not\ set.\ Check\ the\ preferences\ ("Linked\ files")\ or\ modify\ the\ library\ properties\ ("Override\ default\ file\ directories").=Main file directory not set. Check the preferences ("Linked files") or modify the library properties ("Override default file directories"). +Main\ file\ directory\ '%0'\ not\ found.\nCheck\ the\ tab\ "Linked\ files".=Main file directory '%0' not found.\nCheck the tab "Linked files". + This\ operation\ requires\ exactly\ one\ item\ to\ be\ selected.=This operation requires exactly one item to be selected. Opening\ large\ number\ of\ files=Opening large number of files You\ are\ about\ to\ open\ %0\ files.\ Continue?=You are about to open %0 files. Continue? @@ -2530,12 +2532,10 @@ Multiline=Multiline Unable\ to\ open\ linked\ eprint.\ Please\ set\ the\ eprinttype\ field=Unable to open linked eprint. Please set the eprinttype field Unable\ to\ open\ linked\ eprint.\ Please\ verify\ that\ the\ eprint\ field\ has\ a\ valid\ '%0'\ id=Unable to open linked eprint. Please verify that the eprint field has a valid '%0' id -Main\ directory\ not\ found=Main directory not found -Please\ select\ a\ valid\ main\ directory\ under=Please select a valid main directory under Search\ from\ history...=Search from history... your\ search\ history\ is\ empty=your search history is empty -Clear\ history =Clear history +Clear\ history=Clear history Delete\ %0\ files=Delete %0 files Delete\ %0\ files\ permanently\ from\ disk,\ or\ just\ remove\ the\ files\ from\ the\ entry?\ Pressing\ Delete\ will\ delete\ the\ files\ permanently\ from\ disk.=Delete %0 files permanently from disk, or just remove the files from the entry? Pressing Delete will delete the files permanently from disk.