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

Iqss/7189 i18n terms default #7192

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions 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).
15 changes: 7 additions & 8 deletions src/main/java/edu/harvard/iq/dataverse/util/SystemConfig.java
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