-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Add a more descriptive path when Directory cannot be found #7232
Conversation
Please see https://docs.jabref.org/setup/databaseproperties#override-default-file-directories suggestionchange the message to No file directory set or. Check the preferences (linked files) or the library properties |
+ " -> " + Localization.lang("File")); | ||
Localization.lang("Main file directory not set!\n") | ||
+ Localization.lang("Check the Preferences (Linked files)") | ||
+ Localization.lang(" or the Library properties.")); |
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.
It's better and easier for the translators if you put this in one string. See https://devdocs.jabref.org/getting-into-the-code/code-howtos#using-localization-correctly
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.
We should also take care about casing - maybe less is better?
Main file directory not set. Check the preferences (linked files) or the library properties.
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.
Great! I'll work on it
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.
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.
Thanks! Now you need to add this to the resources/l10n/en.properties file as well (see the LocalizationConsistencyTest) under l10n.
When the key contains spaces, you need to add a backslash after the word before the space. (see the other entries in the file)
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.
Now the test fail complaining that a newline is illegal - see: https://github.com/JabRef/jabref/pull/7232/checks?check_run_id=1618423949#step:6:122
java.lang.RuntimeException: Main file directory not set.nCheck the preferences (linked files) or the library properties. contains a new line character. As this is a localization key, this is illegal!
You can try with <br>
or <p>
in the localization - such as other localizations did. Could you please try and report back?
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.
BTW: Hint: How to read error outputs.
- See the red crosses
- Experience in JabRef tells: Click at Details at "Tests / Unit Tests"
- Experience tells to scroll up, until one sees a red "Error"
Then try to understand the error message. I tried to explain the error message at my last commit. My wish, however, is that I am not the only one knowing how to click on "Details", scroll up and find "Error"
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.
You can try with
orin the localization - such as other localizations did. Could you please try and report back?
javafx no longer uses html, so \n is correct
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.
@Siedlerchr May I ask whether you've seent he screen shot error output? Here the deep link to the method throwing the exception:
throw new RuntimeException(languageKey + " contains a new line character. As this is a localization key, this is illegal!"); |
It throws an exception if \n
is contained there. Thus, we cannot use \n
. Since you say that <p>
and <br>
cannot be used, we cannot have any newlines any more. Am I right?
Thanks for the review! I added some changes 😀 |
src/main/java/org/jabref/gui/externalfiles/DownloadFullTextAction.java
Outdated
Show resolved
Hide resolved
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.
Thanks, looks good to me now!
src/main/java/org/jabref/gui/externalfiles/DownloadFullTextAction.java
Outdated
Show resolved
Hide resolved
Huh, I think we totally forgot your PR when thinking about the issue with #7279. But since your PR is now independent of this issue, I don't see any cause not to merge, since every other remark is implemented. |
…dtask * upstream/master: Update guidelines-for-setting-up-a-local-workspace.md (#7339) Updates to colored group indicator for cited entries (#7173) Add some special fields as default columns (#7286) Add a more descriptive path when Directory cannot be found (#7232) Bump antlr4 from 4.9 to 4.9.1 (#7327) Bump unirest-java from 3.11.09 to 3.11.10 (#7329) Bump mockito-core from 3.6.28 to 3.7.0 (#7328) Bump antlr4-runtime from 4.9 to 4.9.1 (#7330) Bump gittools/actions from v0.9.7 to v0.9.8 (#7331) Update to gradle 6.8 (#7324) Link to GitHub contributors in about dialog (#7319) Fix snapcraft upload (#7263)
Issue problem: When you try to download a pdf (Lookup -> Search full documents online ) and you don't have a file directory set, an alert tells you that you should follow a path to set your file directory: Preference -> File. But that path is not correct because to set the file directory you need to follow this path: Options -> Preference -> Linked Files -> Main File Directory
Suggested changes: change the message to: Main file directory not set! Check the Preferences (Linked files) or the Library properties.
Screenshots:

Fixes #7197