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.
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.
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.
Great! I'll work on it
There was a problem hiding this comment.
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.
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.
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.
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.
@Siedlerchr May I ask whether you've seent he screen shot error output? Here the deep link to the method throwing the exception:
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 😀 |
Siedlerchr
left a comment
There was a problem hiding this comment.
Thanks, looks good to me now!
|
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