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

DS-4466 REST API should obtain language settings from Client #2784

Merged
merged 18 commits into from Jul 13, 2020

Conversation

ddinuzzo
Copy link
Contributor

References

Description

This PR add the general infrastructure needed to deal with the accept-language header from the client and test specific to proof that the submission definition are managed properly in a multi-lang environment. The implementation of the multilanguage support in the authority control is left outside as a major rework of this aspects is undergoing.

Checklist

This checklist provides a reminder of what we are going to look for when reviewing your PR. You need not complete this checklist prior to creating your PR (draft PRs are always welcome). If you are unsure about an item in the checklist, don't hesitate to ask. We're here to help!

  • My PR is small in size (e.g. less than 1,000 lines of code, not including comments & integration tests). Exceptions may be made if previously agreed upon.
  • My PR passes Checkstyle validation based on the Code Style Guide.
  • My PR includes Javadoc for all new (or modified) public methods and classes. It also includes Javadoc for large or complex private methods.
  • My PR passes all tests and includes new/updated Unit or Integration Tests based on the Code Testing Guide.
  • If my PR includes new, third-party dependencies (in any pom.xml), I've made sure their licenses align with the DSpace BSD License based on the Licensing of Contributions documentation.
  • If my PR modifies the REST API, I've linked to the REST Contract page (or open PR) related to this change.

@abollini abollini changed the title Ds 4466 new DS-4466 REST API should obtain language settings from Client Jun 23, 2020
@abollini abollini added the interface: REST API v7+ REST API for v7 and later (dspace-server-webapp module) label Jun 23, 2020
@abollini abollini added this to In progress in DSpace 7 Beta 3 via automation Jun 23, 2020
@abollini abollini moved this from In progress to Ready to review in DSpace 7 Beta 3 Jun 23, 2020
@tdonohue tdonohue added this to the 7.0beta3 milestone Jun 23, 2020
@tdonohue tdonohue added the 1 APPROVAL pull request only requires a single approval to merge. label Jun 25, 2020
@heathergreerklein heathergreerklein moved this from Needs Reviewers Assigned to Under Review in DSpace 7 Beta 3 Jun 25, 2020
Copy link
Member

@tdonohue tdonohue left a comment

Choose a reason for hiding this comment

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

👍 Overall, the code here looks great @ddinuzzo ! The tests look good as well & do a good job of providing this works as expected for language-specific submission configurations (which is one of the main use cases). That said, I do have one minor request for JavaDocs inline below. Please update those JavaDocs before we can merge this.

DSpace 7 Beta 3 automation moved this from Under Review to Reviewer approved Jun 29, 2020
@abollini abollini requested a review from tdonohue June 30, 2020 09:23
@abollini
Copy link
Member

@tdonohue this should be ready to go now

@benbosman
Copy link
Member

@ddinuzzo It seems there's no IT yet for the use case of multiple languages in header

Can you add an IT with default locale English and the language header to fr;q=1, it;q=0.9
This should try French (but not find it), and go for the second option Italian (and not go to the default English)

@tdonohue tdonohue modified the milestones: 7.0beta3, 7.0beta4 Jul 2, 2020
Copy link
Member

@benbosman benbosman left a comment

Choose a reason for hiding this comment

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

Thanks @ddinuzzo
This looks good to me, I only found one use case that's not supported
If I set webui.supported.locales = en, de, nl and I have submission forms in nl but not in de, and I use Accept-Language: de;q=0.9,nl;q=0.8,en;q=0.7, this returns the English form (the default)
This is because it's assumed that all webui.supported.locales are available for each submission form, and I18nUtil.isSupportedLocale(current) doesn't take into account whether there's a submission form for this language.

I don't see this as a blocking issue, but I would prefer a github issue would be created for this

@heathergreerklein heathergreerklein added this to Needs Reviewers Assigned in DSpace 7 Beta 4 via automation Jul 8, 2020
@heathergreerklein heathergreerklein moved this from Needs Reviewers Assigned to Reviewer Approved in DSpace 7 Beta 4 Jul 8, 2020
@heathergreerklein heathergreerklein removed this from Reviewer approved in DSpace 7 Beta 3 Jul 8, 2020
@tdonohue
Copy link
Member

This is at +2, merging

@tdonohue tdonohue merged commit 88fbf33 into DSpace:master Jul 13, 2020
DSpace 7 Beta 4 automation moved this from Reviewer Approved to Done Jul 13, 2020
@abollini abollini deleted the DS-4466_new branch August 11, 2020 07:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1 APPROVAL pull request only requires a single approval to merge. interface: REST API v7+ REST API for v7 and later (dspace-server-webapp module)
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

5 participants