diff --git a/dspace-xmlui/src/main/java/cz/cuni/mff/ufal/InvalidContinuationTransformer.java b/dspace-xmlui/src/main/java/cz/cuni/mff/ufal/InvalidContinuationTransformer.java index bb19bcae2918..8dbed12a5570 100644 --- a/dspace-xmlui/src/main/java/cz/cuni/mff/ufal/InvalidContinuationTransformer.java +++ b/dspace-xmlui/src/main/java/cz/cuni/mff/ufal/InvalidContinuationTransformer.java @@ -65,7 +65,13 @@ public class InvalidContinuationTransformer extends AbstractDSpaceTransformer im private static final Message T_dspace_home = message("xmlui.general.dspace_home"); - + + private static final Message T_site_admin = + message("xmlui.error.site_administrator"); + + private static final Message T_here = + message("xmlui.general.here"); + /** Where the body element is stored while we wait to see if it is empty */ private SAXEvent bodyEvent; @@ -178,12 +184,12 @@ public void addBody(Body body) throws SAXException, WingException, String login = contextPath+"/login"; Item item = list.addItem(); item.addHighlight("").addContent(T_head); - item.addXref(login, "here", "signon"); + item.addXref(login, T_here, "signon"); String contact = contextPath+"/contact"; item = list.addItem(); item.addHighlight("").addContent(T_para1); - item.addXref(contact, "site administrator"); + item.addXref(contact, T_site_admin); list.addItem(null, "fa fa-warning fa-5x hangright").addContent(" "); diff --git a/dspace-xmlui/src/main/java/cz/cuni/mff/ufal/dspace/app/xmlui/aspect/statistics/PiwikStatisticsTransformer.java b/dspace-xmlui/src/main/java/cz/cuni/mff/ufal/dspace/app/xmlui/aspect/statistics/PiwikStatisticsTransformer.java index 6e0ad9f832d8..106a5b089079 100644 --- a/dspace-xmlui/src/main/java/cz/cuni/mff/ufal/dspace/app/xmlui/aspect/statistics/PiwikStatisticsTransformer.java +++ b/dspace-xmlui/src/main/java/cz/cuni/mff/ufal/dspace/app/xmlui/aspect/statistics/PiwikStatisticsTransformer.java @@ -30,6 +30,11 @@ public class PiwikStatisticsTransformer extends AbstractDSpaceTransformer { private static Logger log = Logger.getLogger(GAStatisticsTransformer.class); + private static final Message T_alredy_subscribed = message("PiwikStatisticsTransformer.already_subscribed"); + private static final Message T_unsubscribe = message("PiwikStatisticsTransformer.unsubscribe"); + private static final Message T_get_monthly = message("PiwikStatisticsTransformer.get_monthly"); + private static final Message T_subscribe = message("PiwikStatisticsTransformer.subscribe"); + private static final Message T_dspace_home = message("xmlui.general.dspace_home"); private static final Message T_head_title = message("xmlui.statistics.piwik.title"); private static final Message T_statistics_trail = message("xmlui.statistics.piwik.trail"); @@ -86,14 +91,14 @@ public void addBody(Body body) throws SAXException, WingException, Division subscribe = division.addDivision("subscribe", "alert alert-success"); Para para = subscribe.addPara(null, "bold"); para.addHighlight("fa fa-envelope").addContent(" "); - para.addContent(" You are subscribed to receive a monthly report of this item via email "); - para.addXref("?subscribe=no", "Unsubscribe", "btn btn-xs btn-success pull-right bold", ""); + para.addContent(T_alredy_subscribed); + para.addXref("?subscribe=no", T_unsubscribe, "btn btn-xs btn-success pull-right bold", ""); } else { Division subscribe = division.addDivision("subscribe", "alert alert-warning"); Para para = subscribe.addPara(null, "bold"); para.addHighlight("fa fa-envelope").addContent(" "); - para.addContent(" Get a monthly report for this item via email "); - para.addXref("?subscribe=yes", "Subscribe", "btn btn-xs btn-warning pull-right bold", ""); + para.addContent(T_get_monthly); + para.addXref("?subscribe=yes", T_subscribe, "btn btn-xs btn-warning pull-right bold", ""); } } diff --git a/dspace-xmlui/src/main/java/cz/cuni/mff/ufal/dspace/app/xmlui/aspect/submission/submit/UFALExtraMetadataStep.java b/dspace-xmlui/src/main/java/cz/cuni/mff/ufal/dspace/app/xmlui/aspect/submission/submit/UFALExtraMetadataStep.java index d68376f6f702..0663634441a9 100644 --- a/dspace-xmlui/src/main/java/cz/cuni/mff/ufal/dspace/app/xmlui/aspect/submission/submit/UFALExtraMetadataStep.java +++ b/dspace-xmlui/src/main/java/cz/cuni/mff/ufal/dspace/app/xmlui/aspect/submission/submit/UFALExtraMetadataStep.java @@ -513,7 +513,7 @@ else if (inputType.equals("qualdrop_value")) //Only display this field if we have a value to display if (displayValue!=null && displayValue.length()>0) { - reviewSection.addLabel(input.getLabel()); + reviewSection.addLabel(message(input.getLabel())); if (mam.isAuthorityControlled(value.schema, value.element, value.qualifier)) { String confidence = (value.authority != null && value.authority.length() > 0) ? diff --git a/dspace-xmlui/src/main/java/cz/cuni/mff/ufal/dspace/app/xmlui/aspect/submission/submit/UFALLicenseStep.java b/dspace-xmlui/src/main/java/cz/cuni/mff/ufal/dspace/app/xmlui/aspect/submission/submit/UFALLicenseStep.java index 450d347c2a98..052e1ffa09cd 100644 --- a/dspace-xmlui/src/main/java/cz/cuni/mff/ufal/dspace/app/xmlui/aspect/submission/submit/UFALLicenseStep.java +++ b/dspace-xmlui/src/main/java/cz/cuni/mff/ufal/dspace/app/xmlui/aspect/submission/submit/UFALLicenseStep.java @@ -67,6 +67,9 @@ public class UFALLicenseStep extends LicenseStep { protected static final Message T_license_not_supported = message("xmlui.Submission.submit.UFALLicenseStep.license_not_supported"); protected static final Message T_review_msg= message("xmlui.Submission.submit.UFALLicenseStep.review_no_file"); protected static final Message T_review_license_error= message("xmlui.Submission.submit.UFALLicenseStep.review_license_error"); + protected static final Message T_license_select_placeholder= message("xmlui.Submission.submit.UFALLicenseStep.option_placeholder"); + protected static final Message T_license_select_head= message("xmlui.Submission.submit.UFALLicenseStep.select_head"); + protected static final Message T_select_or_label = message("xmlui.Submission.submit.UFALLicenseStep.or_label"); // @@ -166,7 +169,7 @@ public List addBodySelectLicense(Body body) throws SAXException, if (file_uploaded) { form = controls.addList("submit-ufal-license", List.TYPE_FORM, ""); - form.setHead("Select the resource license"); + form.setHead(T_license_select_head); Item selectorLink = form.addItem("", "alert alert-info"); selectorLink.addHighlight("").addContent(T_resource_license_text); @@ -176,7 +179,7 @@ public List addBodySelectLicense(Body body) throws SAXException, selectorLink.addXref("#!", T_license_selector_button, "btn btn-repository licenseselector bold btn-block btn-lg"); Item orLbl = form.addItem(null, "text-center"); - orLbl.addContent("- OR -"); + orLbl.addContent(T_select_or_label); Item helpText2 = form.addItem(); helpText2.addHighlight("license-resource-text").addContent(T_resource_license_text2); @@ -211,7 +214,7 @@ public List addBodySelectLicense(Body body) throws SAXException, if(selected_license!=null && selected_license[0].equals("")) selected_license = null; int selectedId = (selected_license != null && selected_license.length > 0) ? Integer.parseInt(selected_license[0]) : -1; - license_select.addOption(true, "", "Select a License ..."); + license_select.addOption(true, "", T_license_select_placeholder); for (LicenseDefinition license_def : license_defs) { boolean selected = license_def.getLicenseId() == selectedId; diff --git a/dspace-xmlui/src/main/java/org/dspace/app/xmlui/aspect/discovery/AbstractSearch.java b/dspace-xmlui/src/main/java/org/dspace/app/xmlui/aspect/discovery/AbstractSearch.java index 7b019f9c4f59..180cf6890f83 100644 --- a/dspace-xmlui/src/main/java/org/dspace/app/xmlui/aspect/discovery/AbstractSearch.java +++ b/dspace-xmlui/src/main/java/org/dspace/app/xmlui/aspect/discovery/AbstractSearch.java @@ -80,6 +80,9 @@ public abstract class AbstractSearch extends AbstractDSpaceTransformer implement private static final Message T_no_results = message("xmlui.ArtifactBrowser.AbstractSearch.no_results"); + private static final Message T_head_no_items = + message("xmlui.ArtifactBrowser.AbstractSearch.head.no_items"); + private static final Message T_all_of_dspace = message("xmlui.ArtifactBrowser.AbstractSearch.all_of_dspace"); @@ -416,7 +419,7 @@ protected void buildSearchResultsDivision(Division search) } } else { - results.setHead("No items found"); + results.setHead(T_head_no_items); results.addPara(T_no_results); } //}// Empty query diff --git a/dspace-xmlui/src/main/java/org/dspace/app/xmlui/aspect/discovery/SimpleSearch.java b/dspace-xmlui/src/main/java/org/dspace/app/xmlui/aspect/discovery/SimpleSearch.java index 48fc56e8b041..dbcf83be58a0 100644 --- a/dspace-xmlui/src/main/java/org/dspace/app/xmlui/aspect/discovery/SimpleSearch.java +++ b/dspace-xmlui/src/main/java/org/dspace/app/xmlui/aspect/discovery/SimpleSearch.java @@ -79,6 +79,7 @@ public class SimpleSearch extends AbstractSearch implements CacheableProcessingC private static final Message T_filter_authority = message("xmlui.Discovery.SimpleSearch.filter.authority"); private static final Message T_filter_notauthority = message("xmlui.Discovery.SimpleSearch.filter.notauthority"); private static final Message T_did_you_mean = message("xmlui.Discovery.SimpleSearch.did_you_mean"); + private static final Message T_filter_notavailable = message("xmlui.Discovery.SimpleSearch.filter.notavailable"); private SearchService searchService = null; @@ -250,7 +251,7 @@ protected void addFilterRow(java.util.List filterFields, typeSelect.addOption(StringUtils.equals(relationalOperator, "notcontains"), "notcontains", T_filter_notcontain); typeSelect.addOption(StringUtils.equals(relationalOperator, "notequals"), "notequals", T_filter_notequals); //typeSelect.addOption(StringUtils.equals(relationalOperator, "notauthority"), "notauthority", T_filter_notauthority); - typeSelect.addOption(StringUtils.equals(relationalOperator, "notavailable"), "notavailable", "Not Available"); + typeSelect.addOption(StringUtils.equals(relationalOperator, "notavailable"), "notavailable", T_filter_notavailable); diff --git a/dspace-xmlui/src/main/java/org/dspace/app/xmlui/aspect/eperson/EditProfile.java b/dspace-xmlui/src/main/java/org/dspace/app/xmlui/aspect/eperson/EditProfile.java index 6c62bbcdc74c..8ed626ac4de5 100644 --- a/dspace-xmlui/src/main/java/org/dspace/app/xmlui/aspect/eperson/EditProfile.java +++ b/dspace-xmlui/src/main/java/org/dspace/app/xmlui/aspect/eperson/EditProfile.java @@ -165,6 +165,9 @@ public class EditProfile extends AbstractDSpaceTransformer private static final Message T_invalid_item = message("xmlui.EPerson.EditProfile.invalid_item"); + private static final Message T_signed_licenses = + message("xmlui.EPerson.EditProfile.signed_licenses"); + //private static final Message T_head_identify = // message("xmlui.EPerson.EditProfile.head_identify"); @@ -671,7 +674,7 @@ public void addBody(Body body) throws WingException, SQLException { } Division signed = profile.addDivision("signed-licenses", "well well-light"); - signed.setHead("Licenses you signed"); + signed.setHead(T_signed_licenses); add_signed_licenses(signed); // diff --git a/dspace-xmlui/src/main/java/org/dspace/app/xmlui/aspect/statistics/StatisticsTransformer.java b/dspace-xmlui/src/main/java/org/dspace/app/xmlui/aspect/statistics/StatisticsTransformer.java index 1263a32e3570..2292a9aea3af 100644 --- a/dspace-xmlui/src/main/java/org/dspace/app/xmlui/aspect/statistics/StatisticsTransformer.java +++ b/dspace-xmlui/src/main/java/org/dspace/app/xmlui/aspect/statistics/StatisticsTransformer.java @@ -62,6 +62,9 @@ public class StatisticsTransformer extends AbstractDSpaceTransformer { private static final String T_head_visits_countries = "xmlui.statistics.visits.countries"; private static final String T_head_visits_cities = "xmlui.statistics.visits.cities"; private static final String T_head_visits_bitstream = "xmlui.statistics.visits.bitstreams"; + + private static final Message T_most_viewed = message("homepage.most_viewed_items"); + private static final String T_top_week = "homepage.top_week"; private Date dateStart = null; private Date dateEnd = null; @@ -138,7 +141,7 @@ public void renderHome(Body body) throws WingException { Division home = body.addDivision("home", "primary repository"); Division division = home.addDivision("stats", "secondary stats"); - division.setHead("Most Viewed Items"); + division.setHead(T_most_viewed); try { /** List of the top 10 items for the entire repository Last week **/ @@ -151,7 +154,7 @@ public void renderHome(Body body) throws WingException { cal.add(Calendar.WEEK_OF_MONTH, -1); dateFilter.setStartDate(cal.getTime()); statListing.addFilter(dateFilter); - statListing.setTitle("Top Last Week"); + statListing.setTitle(T_top_week); //Adding a new generator for our top 10 items without a name length delimiter DatasetDSpaceObjectGenerator dsoAxis = new DatasetDSpaceObjectGenerator(); diff --git a/dspace-xmlui/src/main/java/org/dspace/app/xmlui/aspect/submission/submit/DescribeStep.java b/dspace-xmlui/src/main/java/org/dspace/app/xmlui/aspect/submission/submit/DescribeStep.java index 94d430039d0e..08e634048a36 100644 --- a/dspace-xmlui/src/main/java/org/dspace/app/xmlui/aspect/submission/submit/DescribeStep.java +++ b/dspace-xmlui/src/main/java/org/dspace/app/xmlui/aspect/submission/submit/DescribeStep.java @@ -78,6 +78,7 @@ */ public class DescribeStep extends AbstractSubmissionStep { + public static final Message T_regexp_error = message("xmlui.Submission.submit.DescribeStep.regexp_error"); private static Logger log = Logger.getLogger(DescribeStep.class); /** Language Strings **/ protected static final Message T_head = @@ -102,6 +103,8 @@ public class DescribeStep extends AbstractSubmissionStep message("xmlui.Submission.submit.DescribeStep.series_name"); protected static final Message T_report_no= message("xmlui.Submission.submit.DescribeStep.report_no"); + protected static final Message T_missing_field = + message("xmlui.Submission.submit.DescribeStep.missing_field"); /** * A shared resource of the inputs reader. The 'inputs' are the @@ -489,7 +492,7 @@ else if (inputType.equals("qualdrop_value")) if (displayValue!=null && displayValue.length()>0) { - describeSection.addLabel(input.getLabel()); + describeSection.addLabel(message(input.getLabel())); if (mam.isAuthorityControlled(value.schema, value.element, value.qualifier)) { String confidence = (value.authority != null && value.authority.length() > 0) ? @@ -602,22 +605,15 @@ else if (dcValues.length == 1) } } // Setup the full name - fullName.setLabel(dcInput.getLabel()); - fullName.setHelp(cleanHints(dcInput.getHints())); + fullName.setLabel(message(dcInput.getLabel())); + fullName.setHelp(message(dcInput.getHints())); if (dcInput.isRequired()) { fullName.setRequired(); } if (isFieldInError(fieldName)) { - if (dcInput.getWarning() != null && dcInput.getWarning().length() > 0) - { - fullName.addError(dcInput.getWarning()); - } - else - { - fullName.addError(T_required_field); - } + setFieldWarning(dcInput, fullName); } if (dcInput.isRepeatable() && !readonly) { @@ -681,22 +677,15 @@ protected void renderDateField(List form, String fieldName, DCInput dcInput, Met Text day = fullDate.addText(fieldName+"_day"); // Set up the full field - fullDate.setLabel(dcInput.getLabel()); - fullDate.setHelp(cleanHints(dcInput.getHints())); + fullDate.setLabel(message(dcInput.getLabel())); + fullDate.setHelp(message(dcInput.getHints())); if (dcInput.isRequired()) { fullDate.setRequired(); } if (isFieldInError(fieldName)) { - if (dcInput.getWarning() != null && dcInput.getWarning().length() > 0) - { - fullDate.addError(dcInput.getWarning()); - } - else - { - fullDate.addError(T_required_field); - } + setFieldWarning(dcInput, fullDate); } if (dcInput.isRepeatable() && !readonly) { @@ -792,22 +781,15 @@ protected void renderSeriesField(List form, String fieldName, DCInput dcInput, M Text number = fullSeries.addText(fieldName+"_number"); // Setup the full field. - fullSeries.setLabel(dcInput.getLabel()); - fullSeries.setHelp(cleanHints(dcInput.getHints())); + fullSeries.setLabel(message(dcInput.getLabel())); + fullSeries.setHelp(message(dcInput.getHints())); if (dcInput.isRequired()) { fullSeries.setRequired(); } if (isFieldInError(fieldName)) { - if (dcInput.getWarning() != null && dcInput.getWarning().length() > 0) - { - fullSeries.addError(dcInput.getWarning()); - } - else - { - fullSeries.addError(T_required_field); - } + setFieldWarning(dcInput, fullSeries); } if (dcInput.isRepeatable() && !readonly) { @@ -870,28 +852,21 @@ protected void renderQualdropField(List form, String fieldName, DCInput dcInput, { String rend = dcInput.getRendsAsString(); rend += " submit-qualdrop"; - + Composite qualdrop = form.addItem().addComposite(fieldName, rend); Select qual = qualdrop.addSelect(fieldName+"_qualifier"); Text value = qualdrop.addText(fieldName+"_value"); // Setup the full field. - qualdrop.setLabel(dcInput.getLabel()); - qualdrop.setHelp(cleanHints(dcInput.getHints())); + qualdrop.setLabel(message(dcInput.getLabel())); + qualdrop.setHelp(message(dcInput.getHints())); if (dcInput.isRequired()) { qualdrop.setRequired(); } if (isFieldInError(fieldName)) { - if (dcInput.getWarning() != null && dcInput.getWarning().length() > 0) - { - qualdrop.addError(dcInput.getWarning()); - } - else - { - qualdrop.addError(T_required_field); - } + setFieldWarning(dcInput, qualdrop); } if (dcInput.isRepeatable() && !readonly) { @@ -909,13 +884,13 @@ protected void renderQualdropField(List form, String fieldName, DCInput dcInput, qual.setDisabled(); value.setDisabled(); } - + // Setup the possible options @SuppressWarnings("unchecked") // This cast is correct java.util.List pairs = dcInput.getPairs(); for (int i = 0; i < pairs.size(); i += 2) { - String display = pairs.get(i); + Message display = message(pairs.get(i)); String returnValue = pairs.get(i+1); qual.addOption(returnValue,display); } @@ -959,8 +934,8 @@ protected void renderTextArea(List form, String fieldName, DCInput dcInput, Meta TextArea textArea = form.addItem().addTextArea(fieldName, rend); // Setup the text area - textArea.setLabel(dcInput.getLabel()); - textArea.setHelp(cleanHints(dcInput.getHints())); + textArea.setLabel(message(dcInput.getLabel())); + textArea.setHelp(message(dcInput.getHints())); String fieldKey = MetadataAuthorityManager.makeFieldKey(dcInput.getSchema(), dcInput.getElement(), dcInput.getQualifier()); boolean isAuth = MetadataAuthorityManager.getManager().isAuthorityControlled(fieldKey); if (isAuth) @@ -980,14 +955,7 @@ protected void renderTextArea(List form, String fieldName, DCInput dcInput, Meta } if (isFieldInError(fieldName)) { - if (dcInput.getWarning() != null && dcInput.getWarning().length() > 0) - { - textArea.addError(dcInput.getWarning()); - } - else - { - textArea.addError(T_required_field); - } + setFieldWarning(dcInput, textArea); } if (dcInput.isRepeatable() && !readonly) { @@ -1069,22 +1037,15 @@ protected void renderChoiceSelectField(List form, String fieldName, Collection c Select select = form.addItem().addSelect(fieldName, rend); //Setup the select field - select.setLabel(dcInput.getLabel()); - select.setHelp(cleanHints(dcInput.getHints())); + select.setLabel(message(dcInput.getLabel())); + select.setHelp(message(dcInput.getHints())); if (dcInput.isRequired()) { select.setRequired(); } if (isFieldInError(fieldName)) { - if (dcInput.getWarning() != null && dcInput.getWarning().length() > 0) - { - select.addError(dcInput.getWarning()); - } - else - { - select.addError(T_required_field); - } + setFieldWarning(dcInput, select); } if (dcInput.isRepeatable() || dcValues.length > 1) { @@ -1142,22 +1103,15 @@ protected void renderDropdownField(List form, String fieldName, DCInput dcInput, Select select = form.addItem().addSelect(fieldName, rend); //Setup the select field - select.setLabel(dcInput.getLabel()); - select.setHelp(cleanHints(dcInput.getHints())); + select.setLabel(message(dcInput.getLabel())); + select.setHelp(message(dcInput.getHints())); if (dcInput.isRequired()) { select.setRequired(); } if (isFieldInError(fieldName)) { - if (dcInput.getWarning() != null && dcInput.getWarning().length() > 0) - { - select.addError(dcInput.getWarning()); - } - else - { - select.addError(T_required_field); - } + setFieldWarning(dcInput, select); } if (dcInput.isRepeatable() || dcValues.length > 1) { @@ -1171,13 +1125,13 @@ protected void renderDropdownField(List form, String fieldName, DCInput dcInput, { select.setDisabled(); } - + // Setup the possible options @SuppressWarnings("unchecked") // This cast is correct java.util.List pairs = dcInput.getPairs(); for (int i = 0; i < pairs.size(); i += 2) { - String display = pairs.get(i); + Message display = message(pairs.get(i)); String value = pairs.get(i+1); select.addOption(value,display); } @@ -1235,22 +1189,15 @@ protected void renderSelectFromListField(List form, String fieldName, DCInput dc } // Setup the field - listField.setLabel(dcInput.getLabel()); - listField.setHelp(cleanHints(dcInput.getHints())); + listField.setLabel(message(dcInput.getLabel())); + listField.setHelp(message(dcInput.getHints())); if (dcInput.isRequired()) { listField.setRequired(); } if (isFieldInError(fieldName)) { - if (dcInput.getWarning() != null && dcInput.getWarning().length() > 0) - { - listField.addError(dcInput.getWarning()); - } - else - { - listField.addError(T_required_field); - } + setFieldWarning(dcInput, listField); } @@ -1258,7 +1205,7 @@ protected void renderSelectFromListField(List form, String fieldName, DCInput dc java.util.List pairs = dcInput.getPairs(); for (int i = 0; i < pairs.size(); i += 2) { - String display = pairs.get(i); + Message display = message(pairs.get(i)); String value = pairs.get(i+1); if(listField instanceof CheckBox) @@ -1322,7 +1269,7 @@ protected void renderComplexField(List form, String fieldName, DCInput dcInput, java.util.List pairs = definition.getValuePairsForInput(name); for (int i = 0; i < pairs.size(); i += 2) { - String display = pairs.get(i); + Message display = message(pairs.get(i)); String value = pairs.get(i+1); select.addOption(value,display); } @@ -1336,14 +1283,15 @@ protected void renderComplexField(List form, String fieldName, DCInput dcInput, } String label = input_map.get("label"); if(label != null){ - field.setLabel(label); + field.setLabel(message(label)); } String help = input_map.get("help"); if(help != null){ - field.setHelp(help); + field.setHelp(message(help)); } String placeholder = input_map.get("placeholder"); if(placeholder != null){ + //This is translated in themes/UFAL/lib/xsl/core/forms.xsl:~1089 field.setPlaceholder(placeholder); } String field_readonly = input_map.get("readonly"); @@ -1372,18 +1320,13 @@ protected void renderComplexField(List form, String fieldName, DCInput dcInput, } // Setup the full name - composite.setLabel(dcInput.getLabel()); - composite.setHelp(cleanHints(dcInput.getHints())); + composite.setLabel(message(dcInput.getLabel())); + composite.setHelp(message(dcInput.getHints())); if (dcInput.isRequired()) { composite.setRequired(); } if (isFieldInError(fieldName) || regexError.containsKey(fieldName)) { - if (dcInput.getWarning() != null - && dcInput.getWarning().length() > 0) { - composite.addError(dcInput.getWarning()); - } else { - composite.addError("Fill all the fields, please."); - } + setFieldWarning(dcInput, composite, true, T_missing_field); } if (dcInput.isRepeatable() && !readonly) { composite.enableAddOperation(); @@ -1439,7 +1382,7 @@ private void fillPartialError(ComplexDefinition definition, String regex = definition.getInput(input_name).get("regexp"); if(!DCInput.isAllowedValue(value, regex)){ //attach the regex error to the right field - field.addError(String.format("The field doesn't match the required regular expression (format) \"%s\"", regex)); + field.addError(T_regexp_error.parameterize(regex)); } } catch (IndexOutOfBoundsException e){ break; @@ -1544,8 +1487,8 @@ protected void renderOneboxField(List form, String fieldName, DCInput dcInput, M } // Setup the select field - text.setLabel(dcInput.getLabel()); - text.setHelp(cleanHints(dcInput.getHints())); + text.setLabel(message(dcInput.getLabel())); + text.setHelp(message(dcInput.getHints())); String fieldKey = MetadataAuthorityManager.makeFieldKey(dcInput.getSchema(), dcInput.getElement(), dcInput.getQualifier()); boolean isAuth = MetadataAuthorityManager.getManager().isAuthorityControlled(fieldKey); if (isAuth) @@ -1572,26 +1515,16 @@ protected void renderOneboxField(List form, String fieldName, DCInput dcInput, M if( !dcInput.isAllowedValue(dcv.value) ) { regexp_warning_issued = true; if (dcInput.getRegexpWarning() != null && dcInput.getRegexpWarning().length() > 0) { - text.addError(dcInput.getRegexpWarning()); + text.addError(message(dcInput.getRegexpWarning())); }else { - text.addError(String.format( - "This value must match the given regular expression [%s].", dcInput.getRegexp()) ); + text.addError(T_regexp_error.parameterize(dcInput.getRegexp()) ); } } } if (isFieldInError(fieldName)) { - if (dcInput.getWarning() != null && dcInput.getWarning().length() > 0) - { - text.addError(dcInput.getWarning()); - } - else - { - if ( !regexp_warning_issued || dcInput.isRequired() ) { - text.addError(T_required_field); - } - } + setFieldWarning(dcInput, text, !regexp_warning_issued || dcInput.isRequired(), T_required_field); } @@ -1664,39 +1597,6 @@ private boolean isFieldInError(String fieldName) return (this.errorFields.contains(fieldName)); } - /** - * There is a problem with the way hints are handled. The class that we use to - * read the input-forms.xml configuration will append and prepend HTML to hints. - * This causes all sorts of confusion when inserting into the DRI page, so this - * method will strip that extra HTML and just leave the cleaned comments. - * - * - * However this method will not remove naughty or sexual innuendoes from the - * field's hints. - * - * - * @param dirtyHints HTML-ized hints - * @return Hints without HTML. - */ - private static final String HINT_HTML_PREFIX = ""; - private static final String HINT_HTML_POSTFIX = ""; - private String cleanHints(String dirtyHints) - { - String clean = (dirtyHints!=null ? dirtyHints : ""); - - if (clean.startsWith(HINT_HTML_PREFIX)) - { - clean = clean.substring(HINT_HTML_PREFIX.length()); - } - - if (clean.endsWith(HINT_HTML_POSTFIX)) - { - clean = clean.substring(0,clean.length() - HINT_HTML_POSTFIX.length()); - } - - return clean; - } - /** * Adds hidden field with the name of the element to jump to using js after page reload * @@ -1761,4 +1661,19 @@ public Map getRegexError(Parameters parameters) return fields; } + + private void setFieldWarning(DCInput dcInput, Field field) throws WingException { + setFieldWarning(dcInput, field, true, T_required_field); + } + + private void setFieldWarning(DCInput dcInput, Field field, boolean useDefault, Message defaultMessage) throws WingException { + if (dcInput.getWarning() != null && dcInput.getWarning().length() > 0) + { + field.addError(message(dcInput.getWarning())); + } + else if (useDefault) + { + field.addError(defaultMessage); + } + } } diff --git a/dspace-xmlui/src/main/java/org/dspace/app/xmlui/aspect/submission/submit/UploadStep.java b/dspace-xmlui/src/main/java/org/dspace/app/xmlui/aspect/submission/submit/UploadStep.java index 4caab236cc49..4e11981d32bc 100644 --- a/dspace-xmlui/src/main/java/org/dspace/app/xmlui/aspect/submission/submit/UploadStep.java +++ b/dspace-xmlui/src/main/java/org/dspace/app/xmlui/aspect/submission/submit/UploadStep.java @@ -155,6 +155,15 @@ public class UploadStep extends AbstractSubmissionStep protected static final Message T_sherpa_more = message("xmlui.aspect.sherpa.submission.more"); + protected static final Message T_submit_remove_all = + message("xmlui.Submission.submit.UploadStep.submit_remove_all"); + + protected static final Message T_column_checksum = + message("xmlui.Submission.submit.UploadStep.column_checksum"); + + protected static final Message T_column_order = + message("xmlui.Submission.submit.UploadStep.column_order"); + /** * Global reference to edit file page * (this is used when a user requests to edit a bitstream) @@ -345,8 +354,8 @@ public void addBody(Body body) throws SAXException, WingException, header.addCellContent(T_column2); // file name header.addCellContent(T_column3); // size header.addCellContent(T_column4); // description - header.addCellContent("Checksum"); - header.addCellContent("Order"); + header.addCellContent(T_column_checksum); + header.addCellContent(T_column_order); // header.addCellContent(T_column5); // format // header.addCellContent(T_column6); // edit button @@ -445,7 +454,7 @@ public void addBody(Body body) throws SAXException, WingException, Button removeSeleceted = c.addButton("submit_remove_selected"); removeSeleceted.setValue(T_submit_remove); Button removeAll = c.addButton("submit_remove_all"); - removeAll.setValue("Remove All Files"); + removeAll.setValue(T_submit_remove_all); } upload = div.addList("submit-upload-new-part2", List.TYPE_FORM); diff --git a/dspace-xmlui/src/main/resources/aspects/Discovery/i18n/messages.xml b/dspace-xmlui/src/main/resources/aspects/Discovery/i18n/messages.xml index dec3f5097c85..ed82064872fb 100644 --- a/dspace-xmlui/src/main/resources/aspects/Discovery/i18n/messages.xml +++ b/dspace-xmlui/src/main/resources/aspects/Discovery/i18n/messages.xml @@ -168,7 +168,8 @@ Not Contains Not Equals Not ID - + Not Available + Related items Showing items related by title, author, creator and subject. diff --git a/dspace-xmlui/src/main/webapp/exception2html.xslt b/dspace-xmlui/src/main/webapp/exception2html.xslt index 588556d5714b..f7ebf512b280 100644 --- a/dspace-xmlui/src/main/webapp/exception2html.xslt +++ b/dspace-xmlui/src/main/webapp/exception2html.xslt @@ -255,7 +255,8 @@ - + + diff --git a/dspace-xmlui/src/main/webapp/i18n/messages.xml b/dspace-xmlui/src/main/webapp/i18n/messages.xml index 573b8f638f82..3442b17f537d 100644 --- a/dspace-xmlui/src/main/webapp/i18n/messages.xml +++ b/dspace-xmlui/src/main/webapp/i18n/messages.xml @@ -37,11 +37,13 @@ Untitled Perform Queue + here Please contact the site administrator if you wish to report this error. If possible, please provide details about what you were doing at the time this error occurred. Contact site administrator Show underlying error stack + site administrator Search Results for Community: {0} Search Results for Collection: {0} - Search Results Showing {0} through {1} out of {2} results Your query "{0}" produced {1} result(s). Communities or Collections matching your query Items matching your query Search produced no results. + No items found All of the Repository title @@ -143,7 +145,6 @@ Contributor Creator - Subject Description Relation Mime-Type @@ -218,9 +219,6 @@ Browsing by Medium Type Medium Type - Browsing by Rights - Browsing by Rights - Rights Withdrawn Items by Title @@ -555,6 +553,7 @@ Invalid item Identify Security + Licenses you signed Verify Email @@ -597,7 +596,6 @@ Sign in Sign in Sign in to Repository - Sign in E-Mail Address The email address and/or password supplied were not valid. Password @@ -620,7 +618,6 @@ Sign in Sign in Sign in to Repository - Sign in User Name The user name and/or password supplied were not valid. Password @@ -887,6 +884,8 @@ Filter Please wait while the controlled vocabulary is loading. There was an issue when loading the controlled vocabulary, please try again later. + Fill all the fields, please. + The field doesn't match the required regular expression (format) "{0}" N/A @@ -930,6 +929,9 @@ The selected license is not supported at the moment. Please follow the procedure described under section "None of these licenses suits your needs". No file was uploaded in the upload step. There is no restriction on the metadata. License specified by you was not found in the database. This is most likely due to an error please contact administrators. + Select a License ... + Select the resource license + - OR - @@ -1032,6 +1034,9 @@ Remove selected files Please note, that you can select licences in the License step of this submission after you upload at least one file. + Remove All Files + Checksum + Order Upload File(s) File @@ -2122,7 +2127,6 @@ You must provide a set id of the target collection. The persistent identifier used by the OAI provider to designate the target collection You must provide a set id of the target collection. - Content being harvested Content being harvested Harvest metadata only. Harvest metadata and references to bitstreams (requires ORE support). @@ -2531,6 +2535,11 @@ Piwik StatisticsBETA Piwik Statistics + You are subscribed to receive a monthly report of this item via email + Get a monthly report for this item via email + Subscribe + Unsubscribe + Download all files in item ({0}) Download file + Acknowledgement + Authors + Project code: {0} + Project name: {0} + Views Over Time + This item is replaced by a newer submission: + This item is replaced by newer submissions: + This item is {0} and licensed under:
+ + + What can you do? + + + Accepted + Click to accept + Add + Remove selected Share link Share link Share link - To pass your submission to another user give them the following link: {0} + To pass your submission to another user give them the following link: {0}. You will also receive an email with this link. + + + Most Viewed Items + Top Last Week + + + Select type of your resource + Type of the resource: "Corpus" refers to text, speech and multimodal corpora. + "Lexical Conceptual Resource" includes lexica, ontologies, dictionaries, word lists etc. + "language Description" covers language models and grammars. + "Technology / Tool / Service" is used for tools, systems, system components etc. + + Please select a resource type for your submission. + Title + Enter the main title of the item in English. + You must enter a main title for this item. + Project URL + Enter the project url. + The supplied url must start with http/https + Demo URL + A url with samples of the resource or, in the case of tools, + of samples of the output. + + The supplied url must start with http/https + Date issued + Please give the date when the submission data were issued if any e.g., 2014-01-21 or at least + the year. + + You must enter the date or at least the year in a valid format. + Should this item be hidden from browse/search? + Indicate whether you want to hide this item from browse and search. Combine with "Upload cmdi" + for weblicht submissions. + + Are you going to upload cmdi file? + Indicate whether you will upload cmdi file in the next step. Combine with "hide" for weblicht + submissions. + + Authors + Enter the names of the authors of this item. Start typing the author's last name and use + autocomplete form that will appear if applicable. End your input by pressing ESC if you don't + want to use the preselected value. + + Please add author(s) + Publisher + Enter the name of the publisher of the previously issued instance of this item, or your home + institution. Start typing the publisher and use autocomplete form that will appear if + applicable. End your input by pressing ESC if you don't want to use the preselected value. + + You must enter the name of the publisher. + Contact person + Person to contact in case of any issues with this submission. + Please fill all the fields for the contact person. + Funding + Acknowledge sponsors and funding that supported work described by this submission. + Description + Enter a description of the submitted data. + Please give us a description + Language + Select the language of the main content of the item. Multiple languages are possible. Start + typing the language and use autocomplete form that will appear if applicable. + + Please choose a language for the resource. + Language + Select the spoken language (in ISO 639-3 format) of the main content of the item (use "N/A" if + not applicable). Multiple languages are possible. Start typing the language and use autocomplete + form that will appear. + + Subject Keywords + Enter appropriate subject keyword or phrase and press the Add button. You can repeat it for + multiple keywords or use separators i.e., comma and semicolon, which will split it accordingly. + Start typing the keyword and use autocomplete form that will appear. End your input by pressing + ESC if you don't want to use the preselected value. + + Please enter at least one subject related to your submission + Size + You can state the extent of the submitted data, eg. the number of tokens. + Media type + Media type of the main content of the item e.g., "text" for + textual corpora or "audio" for audio recordings. + + Media type is required + Media type + Media type of the main content of the item e.g., "text" for + textual corpora or "audio" for audio recordings. + + Media type is required + Detailed type + Choose one of the types + Detailed type + Choose one of the types + Detailed type + Choose one of the types + Language Dependent + Indicate whether the operation of the tool or service is + language dependent or not + + Please indicate whether the tool is language dependent + One: Authors + Enter the names of the author(s) of this item. + Note + Leave a note for the editors/reviewers + Replaces + URL to a related resource that is supplanted, displaced, or superseded by the described + resource. + + Is replaced by + A related resource that supplants, displaces, or supersedes the described resource. + Embargo lift date + Date that the resource will become available e.g., 2014-01-21 + The supplied date does not follow our date pattern \d\d\d\d-\d\d-\d\d e.g., + 2014-01-21 + + ISSN + Other + ISMN + Gov't Doc # + URI + ISBN + N/A + Corpus + Lexical conceptual + Language description + Technology / Tool / Service + N/A + Web Executable + Paper copy + HardDisk + Blu Ray + DVD-R + CD-ROM + Download + Accessible Through Interface + other + N/A + True + False + N/A + text + audio + video + image + N/A + text + video + image + N/A + tool + service + platform + suiteOfTools + infrastructure + architecture + nlpDevelopmentEnvironment + other + N/A + wordList + computationalLexicon + ontology + wordnet + thesaurus + framenet + terminilogicalResource + machineReadableDictionary + lexicon + other + N/A + grammar + other + N/A + EU + Own funds + National + other + N/A + terms + entries + turns + utterances + articles + files + items + seconds + elements + units + minutes + hours + texts + sentences + pages + bytes + tokens + words + keywords + idiomaticExpressions + neologisms + multiWordUnits + expressions + synsets + classes + concepts + lexicalTypes + phoneticUnits + syntacticUnits + semanticUnits + predicates + phonemes + diphones + T-HPairs + syllables + frames + images + kb + mb + gb + rb + shots + unigrams + bigrams + trigrams + 4-grams + 5-grams + n-grams + rules + other + Yes + No + Yes + No + Contact person's given name + Contact person's surname + Family name + Contact person's email + Contact person's institution name + Funding type + Start typing the name/number of the grant... + Grant no. or funding project code + Funding organization + Funding project name + EU Project Identifier (OpenAIRE) + Unit diff --git a/dspace-xmlui/src/main/webapp/themes/UFAL/lib/bootstrap/css/repository.css b/dspace-xmlui/src/main/webapp/themes/UFAL/lib/bootstrap/css/repository.css index b8fa4996babb..4b6ab362ebb4 100644 --- a/dspace-xmlui/src/main/webapp/themes/UFAL/lib/bootstrap/css/repository.css +++ b/dspace-xmlui/src/main/webapp/themes/UFAL/lib/bootstrap/css/repository.css @@ -154,7 +154,6 @@ } #userbox { - position: fixed !important; opacity: 0.75; } @@ -362,4 +361,4 @@ ul.ds-referenceSet-list { #s2id_aspect_administrative_item_EditItemMetadataForm_field_field { width: 100%; -} \ No newline at end of file +} diff --git a/dspace-xmlui/src/main/webapp/themes/UFAL/lib/bootstrap/js/ufal.min.js b/dspace-xmlui/src/main/webapp/themes/UFAL/lib/bootstrap/js/ufal.min.js index cfc7fe390647..74f58063c792 100644 --- a/dspace-xmlui/src/main/webapp/themes/UFAL/lib/bootstrap/js/ufal.min.js +++ b/dspace-xmlui/src/main/webapp/themes/UFAL/lib/bootstrap/js/ufal.min.js @@ -15,6 +15,17 @@ var console = window.console || { jQuery(document) .ready( function () { + jQuery.i18n.load("cs", { + "Funding code:": "Kód projektu:", + "Project name:": "Jméno projektu:", + "used by %s submission(s)": "použito v %s záznamech", + "ISO:": "Kód", + "Language:": "Jazyk", + "used by #%s": "použito %s×", + "Please refer to the submission above for the latest available data. If you nevertheless need the original data, please click ": + "Nejnovější dostupná data najdete v odkazovaném záznamu. Potřebujete-li data původní, klikněte prosím ", + "here": "sem", + }); ufal.click_event = ufal.click_event || jQuery.fn.tap ? "tap" : "click"; jQuery( @@ -78,7 +89,7 @@ jQuery(document) if (jQuery("#aspect_submission_StepTransformer_field_license").length) { jQuery("#aspect_submission_StepTransformer_field_license").select2({ - placeholder: {id: "", text: "Select a license ..."}, + placeholder: {id: "", text: jQuery("#aspect_submission_StepTransformer_field_license option:selected").text()}, allowClear: true, formatResult: function (license) { var id = license.id; @@ -462,7 +473,7 @@ ufal.submissions = { jQuery("#files_section").hide(); jQuery("#replaced_by_alert") .append( - 'Please refer to the submission above for the latest available data. If you nevertheless need the original data, please click here.'); + '' + $.i18n._("Please refer to the submission above for the latest available data. If you nevertheless need the original data, please click ") + '' + $.i18n._("here") + '.'); jQuery("#show_files_link").on('click', function () { jQuery("#show_files_info").hide(); jQuery("#files_section").show(); @@ -483,7 +494,7 @@ ufal.submissions = { function (item, values) { var used_by = ""; if (0 < values[item]) { - used_by = "(used by #" + values[item] + ")"; + used_by = "(" + $.i18n._("used by #%s", values[item]) + ")"; } return "
" + "
" + item + " " + used_by + "
" + "
"; @@ -637,15 +648,14 @@ ufal.submissions = { var project_name = splits[2]; var used_by = ""; if (item in values && 0 < values[item]) { - used_by = "
used by " - + values[item] + " submission(s)"; + used_by = "
" + $.i18n._("used by %s submission(s)", values[item]) + ""; } return "
" + - "
Funding code:
" + + "
" + $.i18n._("Funding code:") + "
" + "
" + funding_code + "
" + - "
Project name:
" + + "
" + $.i18n._("Project name:") + "
" + "
" + project_name + used_by + @@ -713,11 +723,11 @@ ufal.submissions = { source: Object.keys(lang_pairs_iso), highlighter: function (item) { return "
" - + "
ISO:
" + + "
" + $.i18n._("ISO:") + "
" + "
" + lang_pairs_iso[item] + "
" - + "
Language:
" + + "
" + $.i18n._("Language:") + "
" + "
" + item + "
" + "
"; }, diff --git a/dspace-xmlui/src/main/webapp/themes/UFAL/lib/html/cs/dummy.html b/dspace-xmlui/src/main/webapp/themes/UFAL/lib/html/cs/dummy.html new file mode 100644 index 000000000000..e905abf41f21 --- /dev/null +++ b/dspace-xmlui/src/main/webapp/themes/UFAL/lib/html/cs/dummy.html @@ -0,0 +1,5 @@ +
+ +

LINDAT/CLARIN dočasná stránka

+

Než budou hotové překlady přepněte se prosím na anglickou verzi.

+
diff --git a/dspace-xmlui/src/main/webapp/themes/UFAL/lib/html/cs/dummy.xml b/dspace-xmlui/src/main/webapp/themes/UFAL/lib/html/cs/dummy.xml new file mode 100644 index 000000000000..6ce44d741aa6 --- /dev/null +++ b/dspace-xmlui/src/main/webapp/themes/UFAL/lib/html/cs/dummy.xml @@ -0,0 +1,7 @@ + + + Momentálně nepřeloženo + Momentálně nepřeloženo + + + diff --git a/dspace-xmlui/src/main/webapp/themes/UFAL/lib/js/dragndrop.js b/dspace-xmlui/src/main/webapp/themes/UFAL/lib/js/dragndrop.js index df1d03de5134..8e2e45acd129 100644 --- a/dspace-xmlui/src/main/webapp/themes/UFAL/lib/js/dragndrop.js +++ b/dspace-xmlui/src/main/webapp/themes/UFAL/lib/js/dragndrop.js @@ -14,7 +14,7 @@ function init_dragNdrop() { }).bind('drop', ignoreDrag); var dropZone = jQuery( - "
  • Drop file(s) here.
  • ") + "
  • " + $.i18n._("Drop file(s) here.") + "
  • ") .bind('dragover', dragOver).bind('drop', drop).bind('dragleave', dragLeave); @@ -33,7 +33,7 @@ function drop(e) { ignoreDrag(e); var files = e.originalEvent.dataTransfer.files; if (files === null || files === undefined || files.length === 0) { - alert("Can't upload these files."); + alert($.i18n._("Can't upload these files.")); return false; } processFiles(files); @@ -57,6 +57,10 @@ function dragLeave(e) { jQuery(document) .ready( function() { + $.i18n.load("cs",{ + "Can't upload these files.": "Tyto soubory nelze nahrát.", + "Drop file(s) here.": "Přetáhněte soubory sem.", + }); init_dragNdrop(); } ); \ No newline at end of file diff --git a/dspace-xmlui/src/main/webapp/themes/UFAL/lib/js/fileupload.js b/dspace-xmlui/src/main/webapp/themes/UFAL/lib/js/fileupload.js index 1adf4c32a037..3742675fc05f 100644 --- a/dspace-xmlui/src/main/webapp/themes/UFAL/lib/js/fileupload.js +++ b/dspace-xmlui/src/main/webapp/themes/UFAL/lib/js/fileupload.js @@ -1,3 +1,4 @@ +/*jshint multistr: true */ function createRejectedFilesDialog(files, fileUploadDialog) { jQuery('#rejected_files').remove(); var modal_str = '