i18n updates to javascript files and related templates

This commit is contained in:
tworrall 2013-06-11 12:25:01 -04:00
parent 57c962e82a
commit d74176f18d
40 changed files with 373 additions and 106 deletions

View file

@ -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}'
};
</script>
<#--
edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators.AutocompleteObjectPropertyFormGenerator

View file

@ -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>
<#-- Script to enable browsing individuals within a class -->

View file

@ -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);

View file

@ -97,7 +97,17 @@
<p class="requiredHint">* ${i18n().required_fields}</p>
</form>
</section>
<script>
var i18nStrings = {
supplyName: '${i18n().supply_name}',
supplyPrettyUrl: '${i18n().supply_url}',
startUrlWithSlash: '${i18n().start_url_with_slash}',
supplyTemplate: '${i18n().supply_template}',
supplyContentType: '${i18n().supply_content_type}',
selectContentType: '${i18n().select_content_type}',
allCapitalized: '${i18n().all_capitalized}'
};
</script>
${stylesheets.add('<link rel="stylesheet" href="${urls.base}/css/menupage/menuManagement.css" />')}
${stylesheets.add('<link rel="stylesheet" href="${urls.base}/edit/forms/css/customForm.css" />')}

View file

@ -57,5 +57,13 @@
</#if>
</section>
</section>
<script>
var i18nStringsBrowseGroups = {
browseClassGroup: '${i18n().browse_class_group}',
allCapitalized: '${i18n().all_capitalized}',
supplyClassGroup: '${i18n().supply_class_group}',
selectClasses: '${i18n().select_classes_to_display}'
};
</script>
<#--Include JavaScript specific to the types of data getters related to this content-->
<#include "pageManagement--browseClassGroupsScripts.ftl">
<#include "pageManagement--browseClassGroupsScripts.ftl">

View file

@ -11,4 +11,13 @@
<span id="cancelContent"> ${i18n().or} <a class="cancel" href="javascript:" id="cancelContentLink" title="${i18n().cancel_title}">${i18n().cancel_link}</a></span>
</#if>
</section>
<script>
var i18nStringsFixedHtml = {
fixedHtml: '${i18n().fixed_html}',
supplyVariableName: '${i18n().supply_variable_name}',
noApostrophes: '${i18n().apostrophe_not_allowed}',
noDoubleQuotes: '${i18n().double_quote_note_allowed}',
supplyHtml: '${i18n().supply_html}'
};
</script>
${scripts.add('<script type="text/javascript" src="${urls.base}/js/menupage/processFixedHTMLDataGetterContent.js"></script>')}

View file

@ -13,4 +13,13 @@
<span id="cancelContent"> or <a class="cancel" href="javascript:" id="cancelContentLink" title="${i18n().cancel_title}">${i18n().cancel_link}</a></span>
</#if>
</section>
<script>
var i18nStringsSparqlQuery = {
sparqlResults: '${i18n().sparql_query_results}',
supplyQueryVariable: '${i18n().supply_query_variable}',
noApostrophes: '${i18n().apostrophe_not_allowed}',
noDoubleQuotes: '${i18n().double_quote_note_allowed}',
supplyQuery: '${i18n().supply_sparql_query}'
};
</script>
${scripts.add('<script type="text/javascript" src="${urls.base}/js/menupage/processSparqlDataGetterContent.js"></script>')}

View file

@ -152,7 +152,23 @@
<!--Hardcoding for now but should be retrieved from generator: Custom data-->
<#include "pageManagement--customDataScript.ftl">
<script>
var i18nStrings = {
browseClassGroup: '${i18n().browse_class_group}',
fixedHtml: '${i18n().fixed_html}',
sparqlResults: '${i18n().sparql_query_results}',
orString: '${i18n().or}',
deleteString: '${i18n().delete}',
allCapitalized: '${i18n().all_capitalized}',
mapProcessorError: '${i18n().map_processor_error}',
codeProcessingError: '${i18n().code_processing_error}',
supplyName: '${i18n().supply_name}',
supplyPrettyUrl: '${i18n().supply_url}',
startUrlWithSlash: '${i18n().start_url_with_slash}',
supplyTemplate: '${i18n().supply_template}',
selectContentType: '${i18n().select_content_type}'
};
</script>
${stylesheets.add('<link rel="stylesheet" href="${urls.base}/css/menupage/menuManagement.css" />')}
${stylesheets.add('<link rel="stylesheet" href="${urls.base}/css/menupage/pageManagement.css" />')}