Skip to content

Commit

Permalink
Merge pull request #7192 from GlobalDataverseCommunityConsortium/IQSS…
Browse files Browse the repository at this point in the history
…/7189-i18n_terms_default

Iqss/7189 i18n terms default
  • Loading branch information
kcondon authored Aug 13, 2020
2 parents c18f6cf + 0583874 commit 30f4c30
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
5 changes: 5 additions & 0 deletions doc/release-notes/7189-tou-i18n.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
### Terms of Use Display Updates

In this release we’ve fixed an issue that would cause the Application Terms of Use to not display when the user's language is set to a language that does not match one of the languages for which terms were created and registered for that Dataverse installation. Instead of the expected Terms of Use, users signing up could receive the “There are no Terms of Use for this Dataverse installation” message. This could potentially result in some users signing up for an account without having the proper Terms of Use displayed. This will only affect installations that use the :ApplicationTermsOfUse setting.

Please note that there is not currently a native workflow in Dataverse to display updated Terms of Use to a user or to force re-agreement. This would only potentially affect users that have signed up since the upgrade to 4.17 (or a following release if 4.17 was skipped).
15 changes: 7 additions & 8 deletions src/main/java/edu/harvard/iq/dataverse/util/SystemConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -503,14 +503,13 @@ public boolean isThumbnailGenerationDisabledForPDF() {
public String getApplicationTermsOfUse() {
String language = BundleUtil.getCurrentLocale().getLanguage();
String saneDefaultForAppTermsOfUse = BundleUtil.getStringFromBundle("system.app.terms");
String appTermsOfUse = "";
if(language.equalsIgnoreCase(BundleUtil.getDefaultLocale().getLanguage()) )
{
appTermsOfUse = settingsService.getValueForKey(SettingsServiceBean.Key.ApplicationTermsOfUse, saneDefaultForAppTermsOfUse);
}
else
{
appTermsOfUse = settingsService.getValueForKey(SettingsServiceBean.Key.ApplicationTermsOfUse, language, saneDefaultForAppTermsOfUse);
// Get the value for the defaultLocale. IT will either be used as the return
// value, or as a better default than the saneDefaultForAppTermsOfUse if there
// is no language-specific value
String appTermsOfUse = settingsService.getValueForKey(SettingsServiceBean.Key.ApplicationTermsOfUse, saneDefaultForAppTermsOfUse);
//Now get the language-specific value if it exists
if (!language.equalsIgnoreCase(BundleUtil.getDefaultLocale().getLanguage())) {
appTermsOfUse = settingsService.getValueForKey(SettingsServiceBean.Key.ApplicationTermsOfUse, language, appTermsOfUse);
}
return appTermsOfUse;
}
Expand Down

0 comments on commit 30f4c30

Please sign in to comment.