diff --git a/doc/sphinx-guides/source/installation/config.rst b/doc/sphinx-guides/source/installation/config.rst index 69bec48ed04..55643a3d152 100644 --- a/doc/sphinx-guides/source/installation/config.rst +++ b/doc/sphinx-guides/source/installation/config.rst @@ -2506,6 +2506,14 @@ Each set of labels is identified by a curationLabelSet name and a JSON Array of ``curl -X PUT -d '{"Standard Process":["Author contacted", "Privacy Review", "Awaiting paper publication", "Final Approval"], "Alternate Process":["State 1","State 2","State 3"]}' http://localhost:8080/api/admin/settings/:AllowedCurationLabels`` +If the Dataverse Installation supports multiple languages, the curation label translations should be added to the ``CurationLabels`` properties files. (See :ref:`i18n` for more on properties files and internationalization in general.) +Since the Curation labels are free text, while creating the key, it has to be converted to lowercase, replace space with underscore. + +Example:: + + standard_process=Standard Process + author_contacted=Author contacted + .. _:AllowCustomTermsOfUse: :AllowCustomTermsOfUse diff --git a/src/main/java/edu/harvard/iq/dataverse/DatasetPage.java b/src/main/java/edu/harvard/iq/dataverse/DatasetPage.java index 4a864ada2ae..2499642e5b4 100644 --- a/src/main/java/edu/harvard/iq/dataverse/DatasetPage.java +++ b/src/main/java/edu/harvard/iq/dataverse/DatasetPage.java @@ -5647,7 +5647,10 @@ public void setExternalStatus(String status) { if (status == null || status.isEmpty()) { JsfHelper.addInfoMessage(BundleUtil.getStringFromBundle("dataset.externalstatus.removed")); } else { - JH.addMessage(FacesMessage.SEVERITY_INFO, BundleUtil.getStringFromBundle("dataset.externalstatus.header"), BundleUtil.getStringFromBundle("dataset.externalstatus.info", Arrays.asList(status))); + JH.addMessage(FacesMessage.SEVERITY_INFO, BundleUtil.getStringFromBundle("dataset.externalstatus.header"), + BundleUtil.getStringFromBundle("dataset.externalstatus.info", + Arrays.asList(DatasetUtil.getLocaleExternalStatus(status)) + )); } } catch (CommandException ex) { @@ -5656,7 +5659,7 @@ public void setExternalStatus(String status) { JsfHelper.addErrorMessage(msg); } } - + public List getAllowedExternalStatuses() { return settingsWrapper.getAllowedExternalStatuses(dataset); } diff --git a/src/main/java/edu/harvard/iq/dataverse/DatasetVersion.java b/src/main/java/edu/harvard/iq/dataverse/DatasetVersion.java index b766e5d7b58..f211ccd0410 100644 --- a/src/main/java/edu/harvard/iq/dataverse/DatasetVersion.java +++ b/src/main/java/edu/harvard/iq/dataverse/DatasetVersion.java @@ -1,6 +1,7 @@ package edu.harvard.iq.dataverse; import edu.harvard.iq.dataverse.util.MarkupChecker; +import edu.harvard.iq.dataverse.util.BundleUtil; import edu.harvard.iq.dataverse.DatasetFieldType.FieldType; import edu.harvard.iq.dataverse.branding.BrandingUtil; import edu.harvard.iq.dataverse.dataset.DatasetUtil; diff --git a/src/main/java/edu/harvard/iq/dataverse/DataversePage.java b/src/main/java/edu/harvard/iq/dataverse/DataversePage.java index 664658818e3..b48ff725e1e 100644 --- a/src/main/java/edu/harvard/iq/dataverse/DataversePage.java +++ b/src/main/java/edu/harvard/iq/dataverse/DataversePage.java @@ -5,6 +5,7 @@ import edu.harvard.iq.dataverse.authorization.users.AuthenticatedUser; import edu.harvard.iq.dataverse.authorization.users.User; import edu.harvard.iq.dataverse.dataaccess.DataAccess; +import edu.harvard.iq.dataverse.dataset.DatasetUtil; import edu.harvard.iq.dataverse.dataverse.DataverseUtil; import edu.harvard.iq.dataverse.engine.command.Command; import edu.harvard.iq.dataverse.engine.command.exception.CommandException; @@ -1249,8 +1250,10 @@ public Set> getCurationLabelSetOptions() { } // Add an entry for disabled setNames.put(BundleUtil.getStringFromBundle("dataverse.curationLabels.disabled"), SystemConfig.CURATIONLABELSDISABLED); + allowedSetNames.forEach(name -> { - setNames.put(name, name); + String localizedName = DatasetUtil.getLocaleExternalStatus(name) ; + setNames.put(localizedName,name); }); } curationLabelSetOptions = setNames.entrySet(); diff --git a/src/main/java/edu/harvard/iq/dataverse/dataset/DatasetUtil.java b/src/main/java/edu/harvard/iq/dataverse/dataset/DatasetUtil.java index 4e0a89183da..ccf947b8868 100644 --- a/src/main/java/edu/harvard/iq/dataverse/dataset/DatasetUtil.java +++ b/src/main/java/edu/harvard/iq/dataverse/dataset/DatasetUtil.java @@ -568,4 +568,19 @@ public static String getLicenseDescription(DatasetVersion dsv) { License license = dsv.getTermsOfUseAndAccess().getLicense(); return license != null ? license.getShortDescription() : BundleUtil.getStringFromBundle("license.custom.description"); } + + public static String getLocaleExternalStatus(String status) { + String localizedName = "" ; + try { + localizedName = BundleUtil.getStringFromPropertyFile(status.toLowerCase().replace(" ", "_"), "CurationLabels"); + } + catch (Exception e) { + localizedName = status; + } + + if (localizedName == null) { + localizedName = status ; + } + return localizedName; + } } diff --git a/src/main/webapp/dataset.xhtml b/src/main/webapp/dataset.xhtml index 1503a87600a..e96b0a9f1bd 100644 --- a/src/main/webapp/dataset.xhtml +++ b/src/main/webapp/dataset.xhtml @@ -125,7 +125,8 @@ - + + @@ -340,8 +341,9 @@