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

Add a more descriptive path when Directory cannot be found #7232

Merged
merged 8 commits into from
Jan 11, 2021

Conversation

devjuliet
Copy link
Contributor

@devjuliet devjuliet commented Dec 23, 2020

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:
Screen Shot 2020-12-23 at 7 55 15 PM

Fixes #7197

  • Change in CHANGELOG.md described (if applicable)
  • Tests created for changes (if applicable)
  • Manually tested changed features in running JabRef (always required)
  • Screenshots added in PR description (for UI changes)
  • Checked documentation: Is the information available and up to date? If not created an issue at https://github.com/JabRef/user-documentation/issues or, even better, submitted a pull request to the documentation repository.

@Siedlerchr
Copy link
Member

Please see https://docs.jabref.org/setup/databaseproperties#override-default-file-directories
You can define relative directories in the library properties and thus the main file directory can be empty. In addition there's a checkbox to always use the bib file location which will override all other settings.

suggestion

change the message to No file directory set or. Check the preferences (linked files) or the library properties

@devjuliet devjuliet changed the title added more descriptive path when Directory not found Add a more descriptive path when Directory not found Dec 24, 2020
@devjuliet devjuliet marked this pull request as ready for review December 24, 2020 03:01
+ " -> " + Localization.lang("File"));
Localization.lang("Main file directory not set!\n")
+ Localization.lang("Check the Preferences (Linked files)")
+ Localization.lang(" or the Library properties."));
Copy link
Member

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

Copy link
Member

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.

Copy link
Contributor Author

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed to one string and also changed the message 😄
Screen Shot 2020-12-28 at 10 55 33 AM

Copy link
Member

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)

Copy link
Member

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?

Copy link
Member

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.

  1. See the red crosses
    grafik
  2. Experience in JabRef tells: Click at Details at "Tests / Unit Tests"
  3. Experience tells to scroll up, until one sees a red "Error"
    grafik

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"

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can try with
or

in the localization - such as other localizations did. Could you please try and report back?

javafx no longer uses html, so \n is correct

Copy link
Member

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?

@Siedlerchr Siedlerchr added the status: changes required Pull requests that are not yet complete label Dec 29, 2020
@devjuliet
Copy link
Contributor Author

Thanks for the review! I added some changes 😀

Copy link
Member

@Siedlerchr Siedlerchr left a 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!

@koppor koppor mentioned this pull request Dec 31, 2020
5 tasks
@calixtus
Copy link
Member

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.
Sorry for the delay and thanks for your work!

@calixtus calixtus changed the title Add a more descriptive path when Directory not found Add a more descriptive path when Directory cannot be found Jan 11, 2021
@calixtus calixtus merged commit 54f27e9 into JabRef:master Jan 11, 2021
Siedlerchr added a commit that referenced this pull request Jan 13, 2021
…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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: changes required Pull requests that are not yet complete
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Modify the "Directory not found" alert to show a more descriptive path
5 participants