diff --git a/webapp/web/i18n/all.properties b/webapp/web/i18n/all.properties index 8cfa57c7a..ac2ca0b1e 100644 --- a/webapp/web/i18n/all.properties +++ b/webapp/web/i18n/all.properties @@ -221,7 +221,7 @@ error_password_mismatch = Passwords do not match. # manage_publications = manage publications manage_grants_and_projects = manage grants & projects -manage_affiliated_people = manage affiliated people +manage_affiliated_people_link = manage affiliated people group_name = group name scroll_to_menus = scroll to property group menus @@ -538,6 +538,7 @@ update_button = Update # pagemanagement templates ( /templates/freemarker/body/pagemanagement ) # title_capitalized = Title +type_capitalized = Type uri_not_defined = URI for page not defined page_uri = page URI no_pages_defined = There are no pages defined yet. @@ -740,3 +741,106 @@ vitro_bullet_four = Search your data search_vitro = Search VITRO filter_search = filter search +# +# custom form javascript variables ( /templates/freemarker/edit/js) +# +select_an_existing = Select an existing +or_create_new_one = or create a new one. + +sunday = Sunday +monday = Monday +tuesday = Tuesday +wednesday = Wednesday +thursday = Thursday +friday = Friday +saturday = Saturday +january = January +february = February +march = March +april = April +may = May +june = June +july = July +august = August +september = September +october = October +november = November + +# +# miscellaneous javascript variables ( webapp/web/js) +# +select_editor_and_profile = You must select a minimum of 1 editor and profile. + +browse_all = Browse all +content = content + +please_format_email = Please format your e-mail address as: +or_enter_valid_address = or enter another complete and valid email address. + +share_profile_uri = share the URI for this profile +view_profile_in_rdf = view profile in RDF format +close = close + +error_processing_labels = Error processing request: the unchecked labels could not be deleted. + +drag_drop_to_reorder_menus = Drag and drop to reorder menu items +reordering_menus_failed = Reordering of menu items failed. + +page = page +view_page = View page +of_the_results = of the results +there_are_no = There are no +individuals_names_starting_with = individuals whose name starts with +try_another_letter = Please try another letter or browse all. +individuals_in_system = individuals in the system. +select_another_class = Please select another class from the list. + +supply_name = You must supply a title +supply_url = You must supply a pretty URL +start_url_with_slash = The pretty URL must begin with a leading forward slash +supply_template = You must supply a template +supply_content_type = You must supply a content type +select_content_type = You must select content to be included on the page + +delete = delete +map_processor_error = An error has occurred and the map of processors for this content is missing. Please contact the administrator +code_processing_error = An error has occurred and the code for processing this content is missing a component. Please contact the administrator. + +supply_class_group = You must supply a class group +select_classes_to_display = You must select the classes to display + +supply_variable_name = You must supply a variable to save HTML content. +apostrophe_not_allowed = The variable name should not have an apostrophe. +double_quote_note_allowed = The variable name should not have a double quote. +supply_html = You must supply some HTML or text. + +supply_query_variable = You must supply a variable to save query results. +supply_sparql_query = You must supply a Sparql query. + +confirm_page_deletion = Are you sure you wish to delete this page: + +hide_subclasses = hide subclasses +show_subclasses = show subclasses +ontology_capitalized = Ontology +subclasses_capitalized = Subclasses +collapse_all = collapse all +classes_capitalized = Classes +display_rank = Display Rank + +hide_properties = hide properties +show_properties = show properties +local_name = Local Name +group_capitalized = Group +domain_class = Domain Class +range_class = Range Class +sub_properties = Subproperties +subproperty = subproperty + + + + + + + + + diff --git a/webapp/web/js/account/proxyUtils.js b/webapp/web/js/account/proxyUtils.js index 0e41e250e..bbd1f539c 100644 --- a/webapp/web/js/account/proxyUtils.js +++ b/webapp/web/js/account/proxyUtils.js @@ -1,6 +1,8 @@ /* $This file is distributed under the terms of the license in /doc/license.txt$ */ $(document).ready(function(){ + // Get the i18n variables from the template + $.extend(this, i18nStrings); //Remove initial value of input text 'Select an existing last name' $('input[name="proxySelectorAC"]').click(function(){ $(this).val(''); @@ -20,7 +22,7 @@ $(document).ready(function(){ if ($errorAlert !=""){ return false; }else{ - $('#error-alert p').append("You must select a minimum of 1 editor and profile."); + $('#error-alert p').append(i18nStrings.selectEditorAndProfile); return false; } } diff --git a/webapp/web/js/browseClassGroups.js b/webapp/web/js/browseClassGroups.js index 142860383..aa8f0e26a 100644 --- a/webapp/web/js/browseClassGroups.js +++ b/webapp/web/js/browseClassGroups.js @@ -1,5 +1,6 @@ /* $This file is distributed under the terms of the license in /doc/license.txt$ */ + var browseClassGroups = { // Initial page setup onLoad: function() { @@ -11,6 +12,7 @@ var browseClassGroups = { // Add variables from browse template mergeFromTemplate: function() { $.extend(this, browseData); + $.extend(this, i18nStrings); }, // Create references to frequently used elements for convenience @@ -91,7 +93,8 @@ var browseClassGroups = { // Build the content of each list item, piecing together each component listItem = '
  • '; - listItem += ''+ name +''; + listItem += ''+ name +''; listItem += '
  • '; // Add the list item to the array of classes @@ -113,7 +116,9 @@ var browseClassGroups = { classList.splice(potentialSuperClasses, 1); browseAllUrl = browseClassGroups.baseUrl +'/individuallist?vclassId='+ encodeURIComponent(superClassUri); - browseAllLink = 'Browse all »'; + browseAllLink = '' + browseClassGroups.browseAllString + ' »'; browseClassGroups.browseClasses.prepend(browseAllLink); } @@ -166,7 +171,7 @@ var graphClassGroups = { $('rect').each(function() { var index = $('rect').index(this); var label = labels[index]; - var title = 'Browse all '+ label +' content'; + var title = browseClassGroups.browseAllString + ' ' + label + ' ' + browseClassGroups.contentString; // Add a title attribute $(this).attr('title', title); diff --git a/webapp/web/js/commentForm.js b/webapp/web/js/commentForm.js index 182cf9b27..c9173eeb1 100644 --- a/webapp/web/js/commentForm.js +++ b/webapp/web/js/commentForm.js @@ -1,5 +1,7 @@ /* $This file is distributed under the terms of the license in /doc/license.txt$ */ +$.extend(this, i18nStrings); + function ValidateForm(formName) { var x = 0; // counts form elements - used as array index var y = 0; // counts required fields - used as array index @@ -8,7 +10,8 @@ function ValidateForm(formName) { // Check for Email formatting if (document.forms[formName].EmailFields) { - errorList = '\nPlease format your e-mail address as:\n \"userid@institution.edu\" or enter another complete and valid email address'; + errorList = '\n' + i18nStrings.pleaseFormatEmail + '\n\n \"userid@institution.edu\" \n\n' + + i18nStrings.enterValidAddress; // build array of required fields emailStr = document.forms[formName].EmailFields.value; emailFields = emailStr.split(','); diff --git a/webapp/web/js/individual/individualUriRdf.js b/webapp/web/js/individual/individualUriRdf.js index a9ce0a241..422d1db88 100644 --- a/webapp/web/js/individual/individualUriRdf.js +++ b/webapp/web/js/individual/individualUriRdf.js @@ -1,6 +1,9 @@ /* $This file is distributed under the terms of the license in /doc/license.txt$ */ $(document).ready(function(){ + + $.extend(this, i18nStringsUriRdf); + // This function creates and styles the "qTip" tooltip that displays the resource uri and the rdf link when the user clicks the uri/rdf icon. $('span#iconControlsLeftSide').children('img#uriIcon').each(function() { @@ -8,7 +11,7 @@ $(document).ready(function(){ { content: { prerender: true, // We need this for the .click() event listener on 'a.close' - text: '
    share the URI for this profile
    view profile in RDF format
    close' + text: '
    ' + i18nStringsUriRdf.shareProfileUri + '
    ' + i18nStringsUriRdf.viewRDFProfile + '
    ' + i18nStringsUriRdf.closeString + '' }, position: { corner: { @@ -40,7 +43,7 @@ $(document).ready(function(){ { content: { prerender: true, // We need this for the .click() event listener on 'a.close' - text: '
    share the URI for this profile
    view profile in RDF format
    close' + text: '
    ' + i18nStringsUriRdf.shareProfileUri + '
    ' + i18nStringsUriRdf.viewRDFProfile + '
    ' + i18nStringsUriRdf.closeString + '' }, position: { corner: { @@ -72,7 +75,7 @@ $(document).ready(function(){ { content: { prerender: true, // We need this for the .click() event listener on 'a.close' - text: '
    share the URI for this profile
    view profile in RDF format
    close' + text: '
    ' + i18nStringsUriRdf.shareProfileUri + '
    ' + i18nStringsUriRdf.viewRDFProfile + '
    ' + i18nStringsUriRdf.closeString + '' }, position: { corner: { diff --git a/webapp/web/js/individual/manageLabelsForIndividual.js b/webapp/web/js/individual/manageLabelsForIndividual.js index 73a63cad8..cd91e9033 100644 --- a/webapp/web/js/individual/manageLabelsForIndividual.js +++ b/webapp/web/js/individual/manageLabelsForIndividual.js @@ -16,6 +16,7 @@ var manageLabels = { // Get the custom form data from the page $.extend(this, customFormData); + $.extend(this, i18nStrings); }, // Initial page setup. Called only at page load. @@ -81,7 +82,7 @@ var manageLabels = { window.location = $('a.cancel').attr('href'); } else { - alert('Error processing request: the unchecked labels could not be deleted.'); + alert(manageLabels.errorProcessingLabels); selectedRadio.removeAttr('checked'); $('span.or').show(); $('a.cancel').show(); diff --git a/webapp/web/js/individual/menuManagement.js b/webapp/web/js/individual/menuManagement.js index 5572ef7ce..bef48e786 100644 --- a/webapp/web/js/individual/menuManagement.js +++ b/webapp/web/js/individual/menuManagement.js @@ -13,6 +13,7 @@ var menuManagement = { // Add variables from menupage template mergeFromTemplate: function() { $.extend(this, menuManagementData); + $.extend(this, i18nStrings); }, // Create references to frequently used elements for convenience @@ -30,7 +31,7 @@ var menuManagement = { this.menuItemsList.addClass('dragNdrop'); - menuItems.attr('title', 'Drag and drop to reorder menu items'); + menuItems.attr('title', menuManagement.dragDropMenus); @@ -95,7 +96,7 @@ var menuManagement = { ui.item.appendTo(menuItems); } - alert('Reordering of menu items failed.'); + alert(menuManagement.reorderingFailed); } } }); diff --git a/webapp/web/js/individual/propertyGroupControls.js b/webapp/web/js/individual/propertyGroupControls.js index 26f0b91e5..d8d0a51d2 100644 --- a/webapp/web/js/individual/propertyGroupControls.js +++ b/webapp/web/js/individual/propertyGroupControls.js @@ -33,7 +33,7 @@ $(document).ready(function(){ $propertyGroupLi.removeClass("nonSelectedGroupTab clickable"); $propertyGroupLi.addClass("selectedGroupTab clickable"); } - if ( $propertyGroupLi.text() == "View All" ) { + if ( $propertyGroupLi.attr("groupname") == "viewAll" ) { processViewAllTab(); } else { diff --git a/webapp/web/js/menupage/browseByVClass.js b/webapp/web/js/menupage/browseByVClass.js index e22ef9c7d..ced76ada9 100644 --- a/webapp/web/js/menupage/browseByVClass.js +++ b/webapp/web/js/menupage/browseByVClass.js @@ -12,6 +12,7 @@ var browseByVClass = { // Add variables from menupage template mergeFromTemplate: function() { $.extend(this, menupageData); + $.extend(this, i18nStrings); }, // Create references to frequently used elements for convenience @@ -165,10 +166,12 @@ var browseByVClass = { // Print out the pagination nav if called pagination: function(pages, page) { var pagination = '" }); //Hide inner div var $innerDiv = $newDivContainer.children('div#innerContainer' + counter); @@ -638,7 +640,7 @@ var pageManagementUtils = { var selectedClassesList = pageManagementUtils.classesForClassGroup.children('ul#selectedClasses'); selectedClassesList.empty(); - selectedClassesList.append('
  • '); + selectedClassesList.append('
  • '); $.each(results.classes, function(i, item) { var thisClass = results.classes[i]; @@ -740,11 +742,11 @@ var pageManagementUtils = { return jsonObject; } else { //ERROR handling - alert("An error has occurred and the map of processors for this content is missing. Please contact the administrator"); + alert(pageManagementUtils.mapProcessorError); return null; } } - alert("An error has occurred and the code for processing this content is missing a component. Please contact the administrator."); + alert(pageManagementUtils.codeProcessingError); //Error handling here return null; }, @@ -785,21 +787,21 @@ var pageManagementUtils = { // Check menu name if ($('input[type=text][name=pageName]').val() == "") { - validationError += "You must supply a name
    "; + validationError += pageManagementUtils.supplyName + "
    "; } // Check pretty url if ($('input[type=text][name=prettyUrl]').val() == "") { - validationError += "You must supply a pretty URL
    "; + validationError += pageManagementUtils.supplyPrettyUrl + "
    "; } if ($('input[type=text][name=prettyUrl]').val().charAt(0) != "/") { - validationError += "The pretty URL must begin with a leading forward slash
    "; + validationError += pageManagementUtils.startUrlWithSlash + "
    "; } // Check custom template and self contained template var selectedTemplateValue = $('input:radio[name=selectedTemplate]:checked').val(); if (selectedTemplateValue == "custom" || selectedTemplateValue == "selfContained") { if ($('input[name=customTemplate]').val() == "") { - validationError += "You must supply a template
    "; + validationError += pageManagementUtils.supplyTemplate + "
    "; } } @@ -813,7 +815,7 @@ var pageManagementUtils = { var validationErrorMsg = ""; //If there ARE not contents selected, then error message should indicate user needs to add them if(pageContentSections.length == 0) { - validationErrorMsg = "You must select content to be included on the page
    "; + validationErrorMsg = pageManagementUtils.selectContentType + "
    "; } else { //For each, based on type, validate if a validation function exists $.each(pageContentSections, function(i) { diff --git a/webapp/web/js/menupage/processClassGroupDataGetterContent.js b/webapp/web/js/menupage/processClassGroupDataGetterContent.js index e413a8b70..938064cd5 100644 --- a/webapp/web/js/menupage/processClassGroupDataGetterContent.js +++ b/webapp/web/js/menupage/processClassGroupDataGetterContent.js @@ -1,5 +1,6 @@ /* $This file is distributed under the terms of the license in /doc/license.txt$ */ +$.extend(this, i18nStringsBrowseGroups); //Process sparql data getter and provide a json object with the necessary information //Depending on what is included here, a different type of data getter might be used var processClassGroupDataGetterContent = { @@ -34,7 +35,7 @@ var processClassGroupDataGetterContent = { }, //For the label of the content section for editing, need to add additional value retrieveContentLabel:function() { - return "Browse Class Group"; + return i18nStringsBrowseGroups.browseClassGroup; }, retrieveAdditionalLabelText:function(existingContentObject) { var label = ""; @@ -61,7 +62,7 @@ var processClassGroupDataGetterContent = { selectedClassesList.empty(); var newId = "allSelected" + contentNumber; - selectedClassesList.append('
  • '); + selectedClassesList.append('
  • '); $.each(results.classes, function(i, item) { var thisClass = results.classes[i]; @@ -134,14 +135,14 @@ var processClassGroupDataGetterContent = { validateFormSubmission: function(pageContentSection, pageContentSectionLabel) { var validationError = ""; if (pageContentSection.find('select[name="selectClassGroup"]').val() =='-1') { - validationError += pageContentSectionLabel + ": You must supply a class group
    "; + validationError += pageContentSectionLabel + ": " + i18nStringsBrowseGroups.supplyClassGroup + "
    "; } else { //class group has been selected, make sure there is at least one class selected var allSelected = pageContentSection.find('input[name="allSelected"]:checked').length; var noClassesSelected = pageContentSection.find('input[name="classInClassGroup"]:checked').length; if (allSelected == 0 && noClassesSelected == 0) { //at least one class should be selected - validationError += pageContentSectionLabel + ":You must select the classes to display
    "; + validationError += pageContentSectionLabel + ": " + i18nStringsBrowseGroups.selectClasses + "
    "; } } return validationError; diff --git a/webapp/web/js/menupage/processFixedHTMLDataGetterContent.js b/webapp/web/js/menupage/processFixedHTMLDataGetterContent.js index 00395c7dd..25fc5d1d4 100644 --- a/webapp/web/js/menupage/processFixedHTMLDataGetterContent.js +++ b/webapp/web/js/menupage/processFixedHTMLDataGetterContent.js @@ -1,5 +1,6 @@ /* $This file is distributed under the terms of the license in /doc/license.txt$ */ +$.extend(this, i18nStringsFixedHtml); //Process sparql data getter and provide a json object with the necessary information var processFixedHTMLDataGetterContent = { dataGetterClass:null, @@ -30,7 +31,7 @@ var processFixedHTMLDataGetterContent = { }, //For the label of the content section for editing, need to add additional value retrieveContentLabel:function() { - return "Fixed HTML"; + return i18nStringsFixedHtml.fixedHtml; }, //For the label of the content section for editing, need to add additional value retrieveAdditionalLabelText:function(existingContentObject) { @@ -43,17 +44,17 @@ var processFixedHTMLDataGetterContent = { //Check that query and saveToVar have been input var variableValue = pageContentSection.find("input[name='saveToVar']").val(); if(variableValue == "") { - validationError += pageContentSectionLabel + ": You must supply a variable to save HTML content.
    "; + validationError += pageContentSectionLabel + ": " + i18nStringsFixedHtml.supplyVariableName + "
    "; } if(processFixedHTMLDataGetterContent.stringHasSingleQuote(variableValue)) { - validationError += pageContentSectionLabel + ": The variable name should not have an apostrophe .
    "; + validationError += pageContentSectionLabel + ": " + i18nStringsFixedHtml.noApostrophes + "
    "; } if(processFixedHTMLDataGetterContent.stringHasDoubleQuote(variableValue)) { - validationError += pageContentSectionLabel + ": The variable name should not have a double quote .
    "; + validationError += pageContentSectionLabel + ": " + i18nStringsFixedHtml.noDoubleQuotes + "
    "; } var htmlValue = pageContentSection.find("textarea[name='htmlValue']").val(); if(htmlValue == "") { - validationError += pageContentSectionLabel + ": You must supply some HTML or text.
    "; + validationError += pageContentSectionLabel + ": " + i18nStringsFixedHtml.supplyHtml + "
    "; } return validationError; }, diff --git a/webapp/web/js/menupage/processSparqlDataGetterContent.js b/webapp/web/js/menupage/processSparqlDataGetterContent.js index ee54c1bb6..f371de215 100644 --- a/webapp/web/js/menupage/processSparqlDataGetterContent.js +++ b/webapp/web/js/menupage/processSparqlDataGetterContent.js @@ -1,5 +1,7 @@ /* $This file is distributed under the terms of the license in /doc/license.txt$ */ +$.extend(this, i18nStringsSparqlQuery); + //Process sparql data getter and provide a json object with the necessary information var processSparqlDataGetterContent = { dataGetterClass:null, @@ -35,7 +37,7 @@ var processSparqlDataGetterContent = { }, //For the label of the content section for editing, need to add additional value retrieveContentLabel:function() { - return "SPARQL Query Results"; + return i18nStringsSparqlQuery.sparqlResults; }, //For the label of the content section for editing, need to add additional value retrieveAdditionalLabelText:function(existingContentObject) { @@ -48,13 +50,13 @@ var processSparqlDataGetterContent = { //Check that query and saveToVar have been input var variableValue = pageContentSection.find("input[name='saveToVar']").val(); if(variableValue == "") { - validationError += pageContentSectionLabel + ": You must supply a variable to save query results.
    " + validationError += pageContentSectionLabel + ": " + i18nStringsSparqlQuery.supplyQueryVariable + "
    " } if(processSparqlDataGetterContent.stringHasSingleQuote(variableValue)) { - validationError += pageContentSectionLabel + ": The variable name should not have an apostrophe .
    "; + validationError += pageContentSectionLabel + ": " + i18nStringsSparqlQuery.noApostrophes + "
    "; } if(processSparqlDataGetterContent.stringHasDoubleQuote(variableValue)) { - validationError += pageContentSectionLabel + ": The variable name should not have a double quote .
    "; + validationError += pageContentSectionLabel + ": " + i18nStringsSparqlQuery.noDoubleQuotes + "
    "; } //Check that query model does not have single or double quotes within it //Uncomment this/adapt this when we actually allow display the query model input @@ -71,7 +73,7 @@ var processSparqlDataGetterContent = { var queryValue = pageContentSection.find("textarea[name='query']").val(); if(queryValue == "") { - validationError += pageContentSectionLabel + ": You must supply a Sparql query.
    "; + validationError += pageContentSectionLabel + ": " + i18nStringsSparqlQuery.supplyQuery + "
    "; } return validationError; }, diff --git a/webapp/web/js/pageDeletion.js b/webapp/web/js/pageDeletion.js index feab7c3e4..49bff3a6b 100644 --- a/webapp/web/js/pageDeletion.js +++ b/webapp/web/js/pageDeletion.js @@ -1,5 +1,7 @@ /* $This file is distributed under the terms of the license in /doc/license.txt$ */ +$.extend(this, i18nStrings); + var pageDeletion = { // on initial page setup onLoad:function(){ @@ -17,7 +19,7 @@ var pageDeletion = { this.deleteLinks.click(function(event) { var href=$(this).attr("href"); var pageTitle = $(this).attr("pageTitle"); - var confirmResult = confirm("Are you sure you wish to delete this page: " + pageTitle + "?"); + var confirmResult = confirm( i18nStrings.confirmPageDeletion + " " + pageTitle + "?"); if(confirmResult) { //Continue with the link return true; diff --git a/webapp/web/js/siteAdmin/classHierarchyUtils.js b/webapp/web/js/siteAdmin/classHierarchyUtils.js index db9319f61..083224cb0 100644 --- a/webapp/web/js/siteAdmin/classHierarchyUtils.js +++ b/webapp/web/js/siteAdmin/classHierarchyUtils.js @@ -2,6 +2,7 @@ var classHierarchyUtils = { onLoad: function(urlBase,displayOption) { + $.extend(this, i18nStrings); this.imagePath = urlBase + "/images/"; this.displayOption = displayOption; this.initObjects(); @@ -58,15 +59,15 @@ if ( this.displayOption == "group" ) { this.expandAll.click(function() { - if ( classHierarchyUtils.expandAll.text() == "hide subclasses" ) { + if ( classHierarchyUtils.expandAll.text() == i18nStrings.hideSubclasses ) { $('td.subclassCell').parent('tr').hide(); $('table.innerDefinition').hide(); - classHierarchyUtils.expandAll.text("show subclasses"); + classHierarchyUtils.expandAll.text(i18nStrings.showSubclasses); } else { $('td.subclassCell').parent('tr').show(); $('table.innerDefinition').show(); - classHierarchyUtils.expandAll.text("hide subclasses"); + classHierarchyUtils.expandAll.text(i18nStrings.hideSubclasses); } }); } @@ -98,10 +99,10 @@ } if ( this.data.classGroup.length > 0 ) { - classHierarchyUtils.classHtml += "Class Group:" + this.data.classGroup + ""; + classHierarchyUtils.classHtml += "" + i18nStrings.classGroup + ":" + this.data.classGroup + ""; } - classHierarchyUtils.classHtml += "Ontology:" + this.data.ontology + ""; + classHierarchyUtils.classHtml += "" + i18nStrings.ontologyString + ":" + this.data.ontology + ""; if ( descendants.length > 1 ) { @@ -129,7 +130,7 @@ var ctr = 0 $.each(node.children, function() { if ( ctr == 0 ) { - childDetails += "Subclasses:"; + childDetails += "" + i18nStrings.subclassesString + ":"; ctr = ctr + 1; } else { @@ -156,10 +157,10 @@ } if ( this.data.classGroup.length > 0 ) { - childDetails += "Class Group:" + this.data.classGroup + ""; + childDetails += "" + i18nStrings.classGroup + ":" + this.data.classGroup + ""; } - childDetails += "Ontology:" + this.data.ontology + ""; + childDetails += "" + i18nStrings.ontologyString + ":" + this.data.ontology + ""; if ( this.children ) { var grandChildren = classHierarchyUtils.getTheChildren(this); @@ -213,15 +214,15 @@ wireExpandLink: function() { this.expandAll.click(function() { - if ( classHierarchyUtils.expandAll.text() == "expand all" ) { - classHierarchyUtils.expandAll.text("collapse all"); + if ( classHierarchyUtils.expandAll.text() == i18nStrings.expandAll ) { + classHierarchyUtils.expandAll.text(i18nStrings.collapseAll); $('span.headerSpanPlus').addClass("headerSpanMinus"); $('table.classHierarchy').find('span.subclassExpandPlus').addClass("subclassExpandMinus"); $('table.classHierarchy').find('table.subclassTable').show(); $('section#container').find('span.headerSpanPlus').attr('view','more'); } else { - classHierarchyUtils.expandAll.text("expand all"); + classHierarchyUtils.expandAll.text(i18nStrings.expandAll); $('span.headerSpanPlus').removeClass("headerSpanMinus"); $('table.classHierarchy').find('span.subclassExpandPlus').removeClass("subclassExpandMinus"); $('table.classHierarchy').find('table.subclassTable').hide(); @@ -245,10 +246,10 @@ } if ( this.data.classGroup.length > 0 ) { - classHierarchyUtils.classHtml += "Class Group:" + this.data.classGroup + ""; + classHierarchyUtils.classHtml += "" + i18nStrings.classGroup + ":" + this.data.classGroup + ""; } - classHierarchyUtils.classHtml += "Ontology:" + this.data.ontology + ""; + classHierarchyUtils.classHtml += "" + i18nStrings.ontologyString + ":" + this.data.ontology + ""; classHierarchyUtils.classHtml += ""; @@ -271,7 +272,7 @@ var ctr = 0; $.each(this.children, function() { if ( ctr == 0 ) { - descendants += "Classes:"; + descendants += "" + i18nStrings.classesString + ":"; ctr = ctr + 1; } else { @@ -289,7 +290,7 @@ + classHierarchyUtils.classCounter + "'>" ; if ( this.data.displayRank.length > 0 ) { - classHierarchyUtils.classHtml += "Display Rank:" + this.data.displayRank + "" + classHierarchyUtils.classHtml += "" + i18nStrings.displayRank + ":" + this.data.displayRank + "" } classHierarchyUtils.classHtml += descendants; diff --git a/webapp/web/js/siteAdmin/objectPropertyHierarchyUtils.js b/webapp/web/js/siteAdmin/objectPropertyHierarchyUtils.js index 4e5eb28ce..e9ab0a1d5 100644 --- a/webapp/web/js/siteAdmin/objectPropertyHierarchyUtils.js +++ b/webapp/web/js/siteAdmin/objectPropertyHierarchyUtils.js @@ -2,6 +2,7 @@ var objectPropHierarchyUtils = { onLoad: function(urlBase,displayOption,type) { + $.extend(this, i18nStrings); this.imagePath = urlBase + "/images/"; this.propType = type; this.initObjects(); @@ -89,13 +90,13 @@ if ( this.propType == "group" ) { this.expandAll.click(function() { - if ( objectPropHierarchyUtils.expandAll.text() == "hide properties" ) { + if ( objectPropHierarchyUtils.expandAll.text() == i18nStrings.hideProperties ) { $('td.subclassCell').parent('tr').hide(); - objectPropHierarchyUtils.expandAll.text("show properties"); + objectPropHierarchyUtils.expandAll.text(i18nStrings.showProperties); } else { $('td.subclassCell').parent('tr').show(); - objectPropHierarchyUtils.expandAll.text("hide properties"); + objectPropHierarchyUtils.expandAll.text(i18nStrings.hideProperties); } }); } @@ -138,16 +139,16 @@ objectPropHierarchyUtils.classHtml += "
    " + this.name + headerSpan + "
    " + "" ; - objectPropHierarchyUtils.classHtml += ""; - objectPropHierarchyUtils.classHtml += ""; - objectPropHierarchyUtils.classHtml += ""; if ( descendants.length > 1 ) { @@ -174,7 +175,7 @@ var ctr = 0 $.each(node.children, function() { if ( ctr == 0 ) { - childDetails += ""; + childDetails += ""; ctr = ctr + 1; } else { @@ -182,10 +183,10 @@ } if ( this.children.length == 1 ) { - subclassString += " (1 subproperty)"; + subclassString += " (1 " + i18nStrings.subProperty + ")"; } else if ( this.children.length > 1 ) { - subclassString += " (" + this.children.length + " subproperties)"; + subclassString += " (" + this.children.length + " " + i18nStrings.subProperties + ")"; } childDetails += ""; - childDetails += ""; - childDetails += ""; if ( this.children ) { @@ -263,15 +264,15 @@ wireExpandLink: function() { this.expandAll.click(function() { - if ( objectPropHierarchyUtils.expandAll.text() == "expand all" ) { - objectPropHierarchyUtils.expandAll.text("collapse all"); + if ( objectPropHierarchyUtils.expandAll.text() == i18nStrings.expandAll ) { + objectPropHierarchyUtils.expandAll.text(i18nStrings.collapseAll); $('span.headerSpanPlus').addClass("headerSpanMinus"); $('table.classHierarchy').find('span.subclassExpandPlus').addClass("subclassExpandMinus"); $('table.classHierarchy').find('table.subclassTable').show(); $('section#container').find('span.headerSpanPlus').attr('view','more'); } else { - objectPropHierarchyUtils.expandAll.text("expand all"); + objectPropHierarchyUtils.expandAll.text(i18nStrings.expandAll); $('span.headerSpanPlus').removeClass("headerSpanMinus"); $('table.classHierarchy').find('span.subclassExpandPlus').removeClass("subclassExpandMinus"); $('table.classHierarchy').find('table.subclassTable').hide(); @@ -290,16 +291,16 @@ objectPropHierarchyUtils.classHtml += "
    " + this.name + "
    " + "
    Local Name:" + objectPropHierarchyUtils.classHtml += "
    " + i18nStrings.localNameString + ":" + (this.data.internalName.length > 0 ? this.data.internalName : "none" ) + "
    Group:" + objectPropHierarchyUtils.classHtml += "
    " + i18nStrings.groupString + ":" + (this.data.group.length > 0 ? this.data.group : "unspecified" ) + "
    Domain Class:" + objectPropHierarchyUtils.classHtml += "
    " + i18nStrings.domainClass + ":" + (this.data.domainVClass.length > 0 ? this.data.domainVClass : "none" ) + " "; - objectPropHierarchyUtils.classHtml += "Range Class:" + objectPropHierarchyUtils.classHtml += "" + i18nStrings.rangeClass + ":" + (this.data.rangeVClass.length > 0 ? this.data.rangeVClass : "none" ) + "
    Subproperties:
    " + i18nStrings.subProperties + ":Local Name:" + childDetails += "
    " + i18nStrings.localNameString + ":" + (this.data.internalName.length > 0 ? this.data.internalName : "none" ) + "
    Group:" + childDetails += "
    " + i18nStrings.groupString + ":" + (this.data.group.length > 0 ? this.data.group : "unspecified" ) + "
    Domain Class:" + childDetails += "
    " + i18nStrings.domainClass + ":" + (this.data.domainVClass.length > 0 ? this.data.domainVClass : "none" ) + " "; - childDetails += "Range Class:" + childDetails += "" + i18nStrings.rangeClass + ":" + (this.data.rangeVClass.length > 0 ? this.data.rangeVClass : "none" ) + "
    " ; - objectPropHierarchyUtils.classHtml += ""; - objectPropHierarchyUtils.classHtml += ""; - objectPropHierarchyUtils.classHtml += ""; objectPropHierarchyUtils.classHtml += "
    Local Name:" + objectPropHierarchyUtils.classHtml += "
    " + i18nStrings.localNameString + ":" + (this.data.internalName.length > 0 ? this.data.internalName : "none" ) + "
    Group:" + objectPropHierarchyUtils.classHtml += "
    " + i18nStrings.groupString + ":" + (this.data.group.length > 0 ? this.data.group : "unspecified" ) + "
    Domain Class:" + objectPropHierarchyUtils.classHtml += "
    " + i18nStrings.domainClass + ":" + (this.data.domainVClass.length > 0 ? this.data.domainVClass : "none" ) + " "; - objectPropHierarchyUtils.classHtml += "Range Class:" + objectPropHierarchyUtils.classHtml += "" + i18nStrings.rangeClass + ":" + (this.data.rangeVClass.length > 0 ? this.data.rangeVClass : "none" ) + "
    "; @@ -337,7 +338,7 @@ var ctr = 0; $.each(this.children, function() { if ( ctr == 0 ) { - descendants += "Properties:"; + descendants += "" + i18nStrings.propertiesString + ":"; ctr = ctr + 1; } else { @@ -355,7 +356,7 @@ + objectPropHierarchyUtils.classCounter + "'>" ; if ( this.data.displayRank.length > 0 ) { - objectPropHierarchyUtils.classHtml += "Display Rank:" + this.data.displayRank + "" + objectPropHierarchyUtils.classHtml += "" + i18nStrings.displayRank + ":" + this.data.displayRank + "" } objectPropHierarchyUtils.classHtml += descendants; diff --git a/webapp/web/js/vitroUtils.js b/webapp/web/js/vitroUtils.js index 76b84d8c5..da85748fc 100644 --- a/webapp/web/js/vitroUtils.js +++ b/webapp/web/js/vitroUtils.js @@ -5,6 +5,8 @@ $(document).ready(function(){ // Use jQuery() instead of $() alias, because dwr/util.js, loaded on back end editing // pages, overwrites $. // fade out welcome-message when user logs in + $.extend(this, i18nStrings); + jQuery('section#welcome-message').css('display', 'block').delay(2000).fadeOut(1500); // fade in flash-message when user logs out @@ -23,7 +25,7 @@ $(document).ready(function(){ if (!$isFilterOpen) { - console.log("Filer is close = " + $isFilterOpen); + console.log("Filter is closed = " + $isFilterOpen); //Change button filter state to selected //$(this).css('background','url(../../themes/vivo-cornell/images/filteredSearchActive.gif) no-repeat right top'); @@ -47,7 +49,7 @@ $(document).ready(function(){ $isFilterOpen = false; - console.log("close"); + console.log("closed"); } }); @@ -57,7 +59,7 @@ $(document).ready(function(){ $(this).click(function(ev){ ev.preventDefault(); - if ($(this).text() == 'All') { + if ($(this).text() == i18nStrings.allCapitalized) { //Selected filter feedback $('.search-filter-selected').text(''); $('input[name="classgroup"]').val(''); diff --git a/webapp/web/templates/freemarker/body/accounts/userAccounts-myProxiesPanel.ftl b/webapp/web/templates/freemarker/body/accounts/userAccounts-myProxiesPanel.ftl index 02edecc87..7ab9f1b19 100644 --- a/webapp/web/templates/freemarker/body/accounts/userAccounts-myProxiesPanel.ftl +++ b/webapp/web/templates/freemarker/body/accounts/userAccounts-myProxiesPanel.ftl @@ -55,6 +55,9 @@ var proxyContextInfo = { baseUrl: '${urls.base}', ajaxUrl: '${formUrls.proxyAjax}' }; +var i18nStrings = { + selectEditorAndProfile: '${i18n().select_editor_and_profile}' +}; ${stylesheets.add('', diff --git a/webapp/web/templates/freemarker/body/contactForm/contactForm-form.ftl b/webapp/web/templates/freemarker/body/contactForm/contactForm-form.ftl index f44cf31f3..914bc58bc 100644 --- a/webapp/web/templates/freemarker/body/contactForm/contactForm-form.ftl +++ b/webapp/web/templates/freemarker/body/contactForm/contactForm-form.ftl @@ -41,6 +41,12 @@

    * ${i18n().required_fields}

    + ${stylesheets.add('', '')} diff --git a/webapp/web/templates/freemarker/body/individual/individual-menu.ftl b/webapp/web/templates/freemarker/body/individual/individual-menu.ftl index 222d0d6fd..617ad600d 100644 --- a/webapp/web/templates/freemarker/body/individual/individual-menu.ftl +++ b/webapp/web/templates/freemarker/body/individual/individual-menu.ftl @@ -51,6 +51,10 @@ reorderUrl: '${reorderUrl}', positionPredicate: '${positionPredicate}' }; + var i18nStrings = { + dragDropMenus: '${i18n().drag_drop_to_reorder_menus}', + reorderingFailed: '${i18n().reordering_menus_failed}' + }; ${scripts.add('')} diff --git a/webapp/web/templates/freemarker/body/individual/individual-vitro.ftl b/webapp/web/templates/freemarker/body/individual/individual-vitro.ftl index 33b43769d..bd6471d51 100644 --- a/webapp/web/templates/freemarker/body/individual/individual-vitro.ftl +++ b/webapp/web/templates/freemarker/body/individual/individual-vitro.ftl @@ -69,6 +69,13 @@ var individualRdfUrl = '${rdfUrl}'; + ${stylesheets.add('')} diff --git a/webapp/web/templates/freemarker/body/individual/manageLabelsForIndividual.ftl b/webapp/web/templates/freemarker/body/individual/manageLabelsForIndividual.ftl index 1a5693459..0e24140e2 100644 --- a/webapp/web/templates/freemarker/body/individual/manageLabelsForIndividual.ftl +++ b/webapp/web/templates/freemarker/body/individual/manageLabelsForIndividual.ftl @@ -55,6 +55,9 @@ var customFormData = { processingUrl: '${urls.base}/edit/primitiveRdfEdit', individualUri: '${subjectUri!}' }; +var i18nStrings = { + errorProcessingLabels: '${i18n().error_processing_labels}' +}; ${stylesheets.add('')} diff --git a/webapp/web/templates/freemarker/body/manageproxies/manageProxies-list.ftl b/webapp/web/templates/freemarker/body/manageproxies/manageProxies-list.ftl index fc0eb44ea..18ad67874 100644 --- a/webapp/web/templates/freemarker/body/manageproxies/manageProxies-list.ftl +++ b/webapp/web/templates/freemarker/body/manageproxies/manageProxies-list.ftl @@ -188,6 +188,9 @@ var proxyContextInfo = { baseUrl: '${urls.base}', ajaxUrl: '${formUrls.ajax}' }; +var i18nStrings = { + selectEditorAndProfile: '${i18n().select_editor_and_profile}' +}; ${stylesheets.add('')} diff --git a/webapp/web/templates/freemarker/body/pagemanagement/pageList.ftl b/webapp/web/templates/freemarker/body/pagemanagement/pageList.ftl index e2686e1f1..30959e9bd 100644 --- a/webapp/web/templates/freemarker/body/pagemanagement/pageList.ftl +++ b/webapp/web/templates/freemarker/body/pagemanagement/pageList.ftl @@ -73,7 +73,11 @@

    ${i18n().use_capitalized} ${i18n().menu_orering} ${i18n().to_order_menu_items}

    - + ${stylesheets.add('', '')} diff --git a/webapp/web/templates/freemarker/body/partials/browse-classgroups.ftl b/webapp/web/templates/freemarker/body/partials/browse-classgroups.ftl index 215a438dc..d96f96129 100644 --- a/webapp/web/templates/freemarker/body/partials/browse-classgroups.ftl +++ b/webapp/web/templates/freemarker/body/partials/browse-classgroups.ftl @@ -71,6 +71,11 @@ ${stylesheets.add('')} diff --git a/webapp/web/templates/freemarker/body/partials/individual/individual-properties.ftl b/webapp/web/templates/freemarker/body/partials/individual/individual-properties.ftl index f26210c9e..9854636bb 100644 --- a/webapp/web/templates/freemarker/body/partials/individual/individual-properties.ftl +++ b/webapp/web/templates/freemarker/body/partials/individual/individual-properties.ftl @@ -20,7 +20,7 @@ <#elseif property.localName == "organizationForPosition" && editable >

    ${property.name} <@p.addLink property editable /> <@p.verboseDisplay property /> style="padding-top:10px" > - ${i18n().manage_affiliated_people} + ${i18n().manage_affiliated_people_link}

    <#else> diff --git a/webapp/web/templates/freemarker/body/partials/menupage/menupage-scripts.ftl b/webapp/web/templates/freemarker/body/partials/menupage/menupage-scripts.ftl index da186568a..e25a3b4db 100644 --- a/webapp/web/templates/freemarker/body/partials/menupage/menupage-scripts.ftl +++ b/webapp/web/templates/freemarker/body/partials/menupage/menupage-scripts.ftl @@ -29,6 +29,16 @@ defaultBrowseVClassUri: firstBrowseClass //'${firstNonEmptyVClass}' }; + var i18nStrings = { + pageString: '${i18n().page}', + viewPageString: '${i18n().view_page}', + ofTheResults: '${i18n().of_the_results}', + thereAreNo: '${i18n().there_are_no}', + indNamesStartWith: '${i18n().individuals_names_starting_with}', + tryAnotherLetter: '${i18n().try_another_letter}', + indsInSystem: '${i18n().individuals_in_system}', + selectAnotherClass: '${i18n().select_another_class}' + }; diff --git a/webapp/web/templates/freemarker/body/siteAdmin/siteAdmin-classHierarchy.ftl b/webapp/web/templates/freemarker/body/siteAdmin/siteAdmin-classHierarchy.ftl index dc402f436..56883e51e 100644 --- a/webapp/web/templates/freemarker/body/siteAdmin/siteAdmin-classHierarchy.ftl +++ b/webapp/web/templates/freemarker/body/siteAdmin/siteAdmin-classHierarchy.ftl @@ -32,6 +32,17 @@ diff --git a/webapp/web/templates/freemarker/edit/forms/autoCompleteObjectPropForm.ftl b/webapp/web/templates/freemarker/edit/forms/autoCompleteObjectPropForm.ftl index d1ae02c59..58d829fb5 100644 --- a/webapp/web/templates/freemarker/edit/forms/autoCompleteObjectPropForm.ftl +++ b/webapp/web/templates/freemarker/edit/forms/autoCompleteObjectPropForm.ftl @@ -123,6 +123,11 @@ Also multiple types parameter set to true only if more than one type returned--> defaultTypeName: '${propertyNameForDisplay}', // used in repair mode to generate button text baseHref: '${urls.base}/individual?uri=' }; + var i18nStrings = { + selectAnExisting: '${i18n().select_an_existing}', + orCreateNewOne: '${i18n().or_create_new_one}', + selectedString: '${i18n().selected}' + }; <#-- edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators.AutocompleteObjectPropertyFormGenerator diff --git a/webapp/web/templates/freemarker/edit/forms/defaultFormScripts.ftl b/webapp/web/templates/freemarker/edit/forms/defaultFormScripts.ftl index 9ec7b847a..5b575c819 100644 --- a/webapp/web/templates/freemarker/edit/forms/defaultFormScripts.ftl +++ b/webapp/web/templates/freemarker/edit/forms/defaultFormScripts.ftl @@ -59,8 +59,8 @@ // theme_advanced_buttons3_add_before : "tablecontrols,separator", // invalid_elements : "li", // theme_advanced_styles : "Header 1=header1;Header 2=header2;Header 3=header3;Table Row=tableRow1", // Theme specific setting CSS classes - } - }; + } + }; <#-- Script to enable browsing individuals within a class --> diff --git a/webapp/web/templates/freemarker/edit/forms/js/customFormWithAutocomplete.js b/webapp/web/templates/freemarker/edit/forms/js/customFormWithAutocomplete.js index 80ac8b655..1489a0038 100644 --- a/webapp/web/templates/freemarker/edit/forms/js/customFormWithAutocomplete.js +++ b/webapp/web/templates/freemarker/edit/forms/js/customFormWithAutocomplete.js @@ -34,6 +34,7 @@ var customForm = { // Get the custom form data from the page $.extend(this, customFormData); + $.extend(this, i18nStrings); }, // On page load, create references for easy access to form elements. @@ -547,7 +548,7 @@ var customForm = { this.typeName = selectedType.html(); if ( this.editMode == 'edit' ) { var $acSelect = this.acSelections[acTypeKey]; - $acSelect.find('label').html('Selected ' + this.typeName + ':'); + $acSelect.find('label').html( customForm.selectedString + ' ' + this.typeName + ':'); } } // reset to empty values; may not need @@ -590,12 +591,12 @@ var customForm = { var typeText; // First case applies on page load; second case applies when the type gets changed. With multiple // ac fields there are cases where we also have to check if the help text is already there - if (!$(selectedObj).val() || $(selectedObj).hasClass(this.acHelpTextClass) || $(selectedObj).val().substring(0, 18) == "Select an existing" ) { + if (!$(selectedObj).val() || $(selectedObj).hasClass(this.acHelpTextClass) || $(selectedObj).val().substring(0, 18) == customForm.selectAnExisting ) { typeText = this.getTypeNameForLabels($(selectedObj)); - var helpText = "Select an existing " + typeText + " or create a new one."; + var helpText = customForm.selectAnExisting + " " + typeText + " " + customForm.orCreateNewOne ; //Different for object property autocomplete if ( this.acSelectOnly ) { - helpText = "Select an existing " + typeText; + helpText = customForm.selectAnExisting + " " + typeText; } $(selectedObj).val(helpText) .addClass(this.acHelpTextClass); diff --git a/webapp/web/templates/freemarker/edit/forms/menuManagement.ftl b/webapp/web/templates/freemarker/edit/forms/menuManagement.ftl index 7e93da003..a186a765d 100644 --- a/webapp/web/templates/freemarker/edit/forms/menuManagement.ftl +++ b/webapp/web/templates/freemarker/edit/forms/menuManagement.ftl @@ -97,7 +97,17 @@

    * ${i18n().required_fields}

    - + ${stylesheets.add('')} ${stylesheets.add('')} diff --git a/webapp/web/templates/freemarker/edit/forms/pageManagement--browseClassGroups.ftl b/webapp/web/templates/freemarker/edit/forms/pageManagement--browseClassGroups.ftl index 949d8e8cc..2a318e12a 100644 --- a/webapp/web/templates/freemarker/edit/forms/pageManagement--browseClassGroups.ftl +++ b/webapp/web/templates/freemarker/edit/forms/pageManagement--browseClassGroups.ftl @@ -57,5 +57,13 @@ + <#--Include JavaScript specific to the types of data getters related to this content--> - <#include "pageManagement--browseClassGroupsScripts.ftl"> \ No newline at end of file + <#include "pageManagement--browseClassGroupsScripts.ftl"> \ No newline at end of file diff --git a/webapp/web/templates/freemarker/edit/forms/pageManagement--fixedHtml.ftl b/webapp/web/templates/freemarker/edit/forms/pageManagement--fixedHtml.ftl index ecdbe82b9..74001fa1f 100644 --- a/webapp/web/templates/freemarker/edit/forms/pageManagement--fixedHtml.ftl +++ b/webapp/web/templates/freemarker/edit/forms/pageManagement--fixedHtml.ftl @@ -11,4 +11,13 @@ ${i18n().or} ${i18n().cancel_link} + ${scripts.add('')} diff --git a/webapp/web/templates/freemarker/edit/forms/pageManagement--sparqlQuery.ftl b/webapp/web/templates/freemarker/edit/forms/pageManagement--sparqlQuery.ftl index 7ee1c75a7..19f5e6394 100644 --- a/webapp/web/templates/freemarker/edit/forms/pageManagement--sparqlQuery.ftl +++ b/webapp/web/templates/freemarker/edit/forms/pageManagement--sparqlQuery.ftl @@ -13,4 +13,13 @@ or ${i18n().cancel_link} + ${scripts.add('')} diff --git a/webapp/web/templates/freemarker/edit/forms/pageManagement.ftl b/webapp/web/templates/freemarker/edit/forms/pageManagement.ftl index 32f1d76c8..5e1d3811c 100644 --- a/webapp/web/templates/freemarker/edit/forms/pageManagement.ftl +++ b/webapp/web/templates/freemarker/edit/forms/pageManagement.ftl @@ -152,7 +152,23 @@ <#include "pageManagement--customDataScript.ftl"> - + ${stylesheets.add('')} ${stylesheets.add('')} diff --git a/webapp/web/templates/freemarker/page/partials/headScripts.ftl b/webapp/web/templates/freemarker/page/partials/headScripts.ftl index b1c47905c..4bfcbdc98 100644 --- a/webapp/web/templates/freemarker/page/partials/headScripts.ftl +++ b/webapp/web/templates/freemarker/page/partials/headScripts.ftl @@ -1,7 +1,11 @@ <#-- $This file is distributed under the terms of the license in /doc/license.txt$ --> <#-- Template for scripts that must be loaded in the head --> - + diff --git a/webapp/web/templates/freemarker/page/partials/languageSelector.ftl b/webapp/web/templates/freemarker/page/partials/languageSelector.ftl index 991602284..71561b5e1 100644 --- a/webapp/web/templates/freemarker/page/partials/languageSelector.ftl +++ b/webapp/web/templates/freemarker/page/partials/languageSelector.ftl @@ -10,7 +10,7 @@ <#if selectLocale??> <#list selectLocale.locales as locale>
  • - + ${locale.label}