From e78d8da061f2935656c332cf89e4c17b20ea289a Mon Sep 17 00:00:00 2001 From: qqmyers Date: Wed, 12 Aug 2020 09:57:58 -0400 Subject: [PATCH 1/4] Restore change --- .../iq/dataverse/util/SystemConfig.java | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) 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..f28381c2ca0 100644 --- a/src/main/java/edu/harvard/iq/dataverse/util/SystemConfig.java +++ b/src/main/java/edu/harvard/iq/dataverse/util/SystemConfig.java @@ -503,16 +503,16 @@ 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); - } - return appTermsOfUse; + // 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; } public String getApiTermsOfUse() { From 3c1e6a5e16d09686e1468627786ac5fe8934cd24 Mon Sep 17 00:00:00 2001 From: qqmyers Date: Wed, 12 Aug 2020 10:01:43 -0400 Subject: [PATCH 2/4] fix spacing --- .../iq/dataverse/util/SystemConfig.java | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) 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 f28381c2ca0..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,16 +503,15 @@ public boolean isThumbnailGenerationDisabledForPDF() { public String getApplicationTermsOfUse() { String language = BundleUtil.getCurrentLocale().getLanguage(); String saneDefaultForAppTermsOfUse = BundleUtil.getStringFromBundle("system.app.terms"); - // 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; + // 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; } public String getApiTermsOfUse() { From 1b730512c39359edb62fc4c8882f10d571612150 Mon Sep 17 00:00:00 2001 From: Danny Brooke Date: Wed, 12 Aug 2020 14:54:45 -0400 Subject: [PATCH 3/4] adding release note --- doc/release-notes/7189-tou-i18n.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 doc/release-notes/7189-tou-i18n.md diff --git a/doc/release-notes/7189-tou-i18n.md b/doc/release-notes/7189-tou-i18n.md new file mode 100644 index 00000000000..95ed257a8c8 --- /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 computer’s default 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 From 058387406d3bb96e7405da648b6cbc071566eeb1 Mon Sep 17 00:00:00 2001 From: Danny Brooke Date: Wed, 12 Aug 2020 15:01:32 -0400 Subject: [PATCH 4/4] update based on CR feedback --- doc/release-notes/7189-tou-i18n.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/release-notes/7189-tou-i18n.md b/doc/release-notes/7189-tou-i18n.md index 95ed257a8c8..4ae0a86b638 100644 --- a/doc/release-notes/7189-tou-i18n.md +++ b/doc/release-notes/7189-tou-i18n.md @@ -1,5 +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 computer’s default 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. +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