diff --git a/doc/release-notes/7189-tou-i18n.md b/doc/release-notes/7189-tou-i18n.md new file mode 100644 index 00000000000..4ae0a86b638 --- /dev/null +++ b/doc/release-notes/7189-tou-i18n.md @@ -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). \ No newline at end of file diff --git a/src/main/java/edu/harvard/iq/dataverse/util/SystemConfig.java b/src/main/java/edu/harvard/iq/dataverse/util/SystemConfig.java index 559f698f5ec..9c801f5197d 100644 --- a/src/main/java/edu/harvard/iq/dataverse/util/SystemConfig.java +++ b/src/main/java/edu/harvard/iq/dataverse/util/SystemConfig.java @@ -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; }