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
Changes from 2 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
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