internationalization changes for java script files
This commit is contained in:
parent
041c091268
commit
2c49931672
60 changed files with 720 additions and 502 deletions
|
@ -1,10 +1,12 @@
|
|||
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
|
||||
|
||||
$.extend(this, i18nStrings);
|
||||
|
||||
var ComparisonDataTableWidget = Class.extend({
|
||||
|
||||
dom: {
|
||||
firstFilterLabel: "Organizations",
|
||||
secondFilterLabel: "People",
|
||||
firstFilterLabel: i18nStrings.organizationsString,
|
||||
secondFilterLabel: i18nStrings.peopleString,
|
||||
|
||||
searchBarParentContainerClass : "comparisonSearchbar",
|
||||
paginationContainerClass : "paginatedtabs",
|
||||
|
@ -67,7 +69,7 @@ var ComparisonDataTableWidget = Class.extend({
|
|||
' | ' +
|
||||
'<span id="' + dom.secondFilterID + '" class="' + dom.filterOptionClass + '">' + dom.secondFilterLabel + '</span>' +
|
||||
*/
|
||||
'<img class="' + dom.filterInfoIconClass + '" id="comparisonImageIconTwo" src="'+ infoIconUrl +'" alt="information icon" title="" /></div>');
|
||||
'<img class="' + dom.filterInfoIconClass + '" id="comparisonImageIconTwo" src="'+ infoIconUrl +'" alt="' + i18nStrings.infoIconString + '" title="" /></div>');
|
||||
me.tableDiv.append(filter);
|
||||
createToolTip($("#comparisonImageIconTwo"), $("#comparisonToolTipTwo").html(), "topLeft");
|
||||
initFilter(dom);
|
||||
|
@ -81,7 +83,7 @@ var ComparisonDataTableWidget = Class.extend({
|
|||
var tr = $('<tr>');
|
||||
|
||||
var levelOfScienceAreaTH = $('<th>');
|
||||
levelOfScienceAreaTH.html('Entity Type');
|
||||
levelOfScienceAreaTH.html(i18nStrings.entityTypeString);
|
||||
|
||||
var checkBoxTH = $('<th>');
|
||||
checkBoxTH.html('');
|
||||
|
@ -89,13 +91,13 @@ var ComparisonDataTableWidget = Class.extend({
|
|||
var scienceAreasTH = $('<th>');
|
||||
scienceAreasTH.attr("id", "comparison-science-areas-th");
|
||||
if (this.currentSelectedFilter === COMPARISON_TYPE.ORGANIZATION ) {
|
||||
scienceAreasTH.html('Organization');
|
||||
scienceAreasTH.html(i18nStrings.organizationString);
|
||||
} else {
|
||||
scienceAreasTH.html('Person');
|
||||
scienceAreasTH.html(i18nStrings.personString);
|
||||
}
|
||||
|
||||
var activityCountTH = $('<th width="53">');
|
||||
activityCountTH.html('# of pubs.');
|
||||
activityCountTH.html('# ' + i18nStrings.numberOfPubs);
|
||||
activityCountTH.attr("id", "activity-count-column");
|
||||
|
||||
tr.append(levelOfScienceAreaTH);
|
||||
|
@ -144,7 +146,7 @@ var ComparisonDataTableWidget = Class.extend({
|
|||
if (element.attr('checked')) {
|
||||
if ($("input:checkbox[class=chk]:checked").length > 3) {
|
||||
element.attr('checked', false);
|
||||
alert("The maximum number of items for comparison is 3.");
|
||||
alert(i18nStrings.maxNbrForComp);
|
||||
} else {
|
||||
me.loadEntity(item.uri, index);
|
||||
}
|
||||
|
@ -180,7 +182,7 @@ var ComparisonDataTableWidget = Class.extend({
|
|||
"bInfo": true,
|
||||
"oLanguage": {
|
||||
"sInfo": "_START_ - _END_ of _TOTAL_",
|
||||
"sInfoEmpty": "No matching science areas found",
|
||||
"sInfoEmpty": i18nStrings.noMatchingScienceAreas,
|
||||
"sInfoFiltered": ""
|
||||
},
|
||||
"sPaginationType": "gmail_style",
|
||||
|
@ -198,8 +200,8 @@ var ComparisonDataTableWidget = Class.extend({
|
|||
/* Create search box */
|
||||
var searchInputBox = $("." + me.dom.searchBarParentContainerClass).find("input[type=text]");
|
||||
searchInputBox.css("width", "140px");
|
||||
searchInputBox.after("<span id='comparison-reset-search' title='Clear search query'>X</span>"
|
||||
+ "<img class='comparisonFilterInfoIcon' id='comparisonSearchInfoIcon' src='" + infoIconUrl + "' alt='information icon' title='' />");
|
||||
searchInputBox.after("<span id='comparison-reset-search' title='" + i18nStrings.clearSearchQuery + "'>X</span>"
|
||||
+ "<img class='comparisonFilterInfoIcon' id='comparisonSearchInfoIcon' src='" + infoIconUrl + "' alt='" + i18nStrings.infoIconString + "' title='' />");
|
||||
$("#comparison-reset-search").live('click', function() {
|
||||
me.widget.fnFilter("");
|
||||
});
|
||||
|
@ -208,18 +210,18 @@ var ComparisonDataTableWidget = Class.extend({
|
|||
/* Create csv download button */
|
||||
var csvButton = '<hr class="subtle-hr"/><div id="main-science-areas-table-footer"><a href="' +
|
||||
comparisonScienceMapCsvDataUrlPrefix + me.uri +
|
||||
'" class="map-of-science-links">Save All as CSV</a></div>';
|
||||
'" class="map-of-science-links">' + i18nStrings.saveAllAsCSV + '</a></div>';
|
||||
me.tableDiv.append(csvButton);
|
||||
},
|
||||
changeFilter: function(filterType) {
|
||||
var me = this;
|
||||
if (filterType === COMPARISON_TYPE.ORGANIZATION) {
|
||||
|
||||
$("#comparison-science-areas-th").html("Organization");
|
||||
$("#comparison-science-areas-th").html(i18nStrings.organizationString);
|
||||
me.currentSelectedFilter = COMPARISON_TYPE.ORGANIZATION;
|
||||
} else {
|
||||
|
||||
$("#comparison-science-areas-th").html("Person");
|
||||
$("#comparison-science-areas-th").html(i18nStrings.personString);
|
||||
me.currentSelectedFilter = COMPARISON_TYPE.PERSON;
|
||||
|
||||
}
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
|
||||
$.extend(this, i18nStrings);
|
||||
|
||||
COMPARISON = {
|
||||
"one":{ "name": "one", "color": "#99CC00"},
|
||||
"two":{ "name": "two", "color": "#FF9900"},
|
||||
|
@ -85,7 +87,7 @@ var ComparisonScimapWidget = Class.extend({
|
|||
me.disciplineLabelsControl = new CheckBoxPanel({
|
||||
map: map,
|
||||
checked: true,
|
||||
text: "Show discipline labels",
|
||||
text: i18nStrings.showDisciplineLabels,
|
||||
click: function() {
|
||||
if($(this).attr('checked')) {
|
||||
me.labelsMarkerManager.showMarkers();
|
||||
|
@ -250,7 +252,7 @@ var ComparisonScimapWidget = Class.extend({
|
|||
if (compositeManager) {
|
||||
var length = compositeManager.length();
|
||||
var slider = this.sliderControl;
|
||||
slider.setTypeString("subdisciplines");
|
||||
slider.setTypeString(i18nStrings.subdisciplinesLower);
|
||||
slider.setMin(Math.min(1, length));
|
||||
slider.setMax(length);
|
||||
slider.setValue(length);
|
||||
|
|
|
@ -1,10 +1,12 @@
|
|||
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
|
||||
|
||||
$.extend(this, i18nStrings);
|
||||
|
||||
var DataTableWidget = Class.extend({
|
||||
|
||||
dom: {
|
||||
firstFilterLabel: "554 Subdisciplines",
|
||||
secondFilterLabel: "13 Disciplines",
|
||||
firstFilterLabel: "554 " + i18nStrings.subdisciplinesString,
|
||||
secondFilterLabel: "13 " + i18nStrings.disciplinesString,
|
||||
|
||||
searchBarParentContainerClass: "searchbar",
|
||||
paginationContainerClass: "paginatedtabs",
|
||||
|
@ -118,22 +120,22 @@ var DataTableWidget = Class.extend({
|
|||
var tr = $('<tr>');
|
||||
|
||||
var levelOfScienceAreaTH = $('<th>');
|
||||
levelOfScienceAreaTH.html('Level of Science Area');
|
||||
levelOfScienceAreaTH.html(i18nStrings.scienceAreaLevel);
|
||||
|
||||
var scienceAreasTH = $('<th>');
|
||||
scienceAreasTH.attr("id", "science-areas-th");
|
||||
if (this.currentSelectedFilter === SCIMAP_TYPE.SUBDISCIPLINE ) {
|
||||
scienceAreasTH.html('Subdisciplines');
|
||||
scienceAreasTH.html(i18nStrings.subdisciplinesString);
|
||||
} else {
|
||||
scienceAreasTH.html('Disciplines');
|
||||
scienceAreasTH.html(i18nStrings.disciplinesString);
|
||||
}
|
||||
|
||||
var activityCountTH = $('<th>');
|
||||
activityCountTH.html('# of pubs.');
|
||||
activityCountTH.html('# ' + i18nStrings.numberOfPubs);
|
||||
activityCountTH.attr("id", "activity-count-column");
|
||||
|
||||
var percentageActivityTH = $('<th>');
|
||||
percentageActivityTH.html('% of activity');
|
||||
percentageActivityTH.html('% ' + i18nStrings.ofActivityString);
|
||||
percentageActivityTH.attr("id", "percentage-activity-column");
|
||||
|
||||
tr.append(levelOfScienceAreaTH);
|
||||
|
@ -209,7 +211,7 @@ var DataTableWidget = Class.extend({
|
|||
"bInfo": true,
|
||||
"oLanguage": {
|
||||
"sInfo": "_START_ - _END_ of _TOTAL_",
|
||||
"sInfoEmpty": "No matching science areas found",
|
||||
"sInfoEmpty": i18nStrings.noMatchingScienceAreas,
|
||||
"sInfoFiltered": ""
|
||||
},
|
||||
"sPaginationType": "gmail_style",
|
||||
|
@ -227,8 +229,9 @@ var DataTableWidget = Class.extend({
|
|||
|
||||
var searchInputBox = $("." + me.dom.searchBarParentContainerClass).find("input[type=text]");
|
||||
searchInputBox.css("width", "140px");
|
||||
searchInputBox.after("<span id='reset-search' title='Clear search query'>X</span>"
|
||||
+ "<img class='filterInfoIcon' id='searchInfoIcon' src='" + infoIconUrl + "' alt='information icon' title='' />");
|
||||
searchInputBox.after("<span id='reset-search' title='" + i18nStrings.clearSearchQuery + "'>X</span>"
|
||||
+ "<img class='filterInfoIcon' id='searchInfoIcon' src='" + infoIconUrl
|
||||
+ "' alt='" + i18nStrings.infoIconString + "' title='' />");
|
||||
$("#reset-search").live('click', function() {
|
||||
me.widget.fnFilter("");
|
||||
});
|
||||
|
@ -236,7 +239,7 @@ var DataTableWidget = Class.extend({
|
|||
|
||||
var csvButton = '<hr class="subtle-hr"/><div id="main-science-areas-table-footer"><a id="csv" href="' +
|
||||
entityMapOfScienceSubDisciplineCSVURL +
|
||||
'" class="map-of-science-links">Save All as CSV</a></div>';
|
||||
'" class="map-of-science-links">' + i18nStrings.saveAllAsCSV + '</a></div>';
|
||||
this.tableDiv.append(csvButton);
|
||||
|
||||
var totalPublications = me.pubsWithNoJournals + me.pubsWithInvalidJournals + me.pubsMapped;
|
||||
|
@ -249,7 +252,7 @@ var DataTableWidget = Class.extend({
|
|||
var me = this;
|
||||
if (filterType === SCIMAP_TYPE.SUBDISCIPLINE) {
|
||||
|
||||
$("#science-areas-th").html("Subdisciplines");
|
||||
$("#science-areas-th").html(i18nStrings.subdisciplinesString);
|
||||
if (me.widget) {
|
||||
me.widget.fnSettings()._iDisplayLength = 10;
|
||||
}
|
||||
|
@ -258,7 +261,7 @@ var DataTableWidget = Class.extend({
|
|||
|
||||
} else {
|
||||
|
||||
$("#science-areas-th").html("Disciplines");
|
||||
$("#science-areas-th").html(i18nStrings.disciplinesString);
|
||||
me.currentSelectedFilter = SCIMAP_TYPE.DISCIPLINE;
|
||||
if (me.widget) {
|
||||
me.widget.fnSettings()._iDisplayLength = 13;
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
|
||||
|
||||
$.extend(this, i18nStrings);
|
||||
|
||||
var ErrorDisplayWidget = Class.extend({
|
||||
|
||||
container: '',
|
||||
|
@ -36,7 +38,7 @@ var ErrorDisplayWidget = Class.extend({
|
|||
* */
|
||||
if (isZeroPublicationsCase) {
|
||||
|
||||
newErrorMessage += "No publications in the system have been attributed to this " + errorForType.toLowerCase() + ".";
|
||||
newErrorMessage += i18nStrings.noAttributedPubs + " " + errorForType.toLowerCase() + ".";
|
||||
|
||||
} else {
|
||||
/*
|
||||
|
@ -60,12 +62,14 @@ var ErrorDisplayWidget = Class.extend({
|
|||
var newErrorMessage = "";
|
||||
|
||||
if (totalPublications > 1) {
|
||||
newErrorMessage = "None of the " + totalPublications + " publications attributed to this "
|
||||
+ errorForType.toLowerCase() + " have been 'science-located'.";
|
||||
newErrorMessage = i18nStrings.noneOfThe + " " + totalPublications + " "
|
||||
+ i18nStrings.pubsAttributedTo + " "
|
||||
+ errorForType.toLowerCase()
|
||||
+ " " + i18nStrings.beenScienceLocated;
|
||||
|
||||
} else {
|
||||
newErrorMessage = "The publication attributed to this "
|
||||
+ errorForType.toLowerCase() + " has not been 'science-located'.";
|
||||
newErrorMessage = i18nStrings.pubAttributedTo + " "
|
||||
+ errorForType.toLowerCase() + " " + i18nStrings.notScienceLocated;
|
||||
}
|
||||
|
||||
|
||||
|
@ -73,19 +77,19 @@ var ErrorDisplayWidget = Class.extend({
|
|||
|
||||
if (responseData.pubsWithNoJournals && responseData.pubsWithNoJournals > 0) {
|
||||
|
||||
var publicationsText = (responseData.pubsWithNoJournals > 1) ? "publications" : "publication";
|
||||
var publicationsText = (responseData.pubsWithNoJournals > 1) ? i18nStrings.publicationsString : i18nStrings.publicationString;
|
||||
|
||||
newErrorMessage += "<li>" + responseData.pubsWithNoJournals + " " + publicationsText + " have no journal"
|
||||
+ " information.</li>"
|
||||
newErrorMessage += "<li>" + responseData.pubsWithNoJournals + " " + publicationsText
|
||||
+ " " + i18nStrings.noJournalInformation + "</li>"
|
||||
|
||||
}
|
||||
|
||||
if (responseData.pubsWithInvalidJournals && responseData.pubsWithInvalidJournals > 0) {
|
||||
|
||||
var publicationsText = (responseData.pubsWithInvalidJournals > 1) ? "publications" : "publication";
|
||||
var publicationsText = (responseData.pubsWithInvalidJournals > 1) ? i18nStrings.publicationsString : i18nStrings.publicationString;
|
||||
|
||||
newErrorMessage += "<li>" + responseData.pubsWithInvalidJournals + " " + publicationsText + " "
|
||||
+ " could not be matched with a map location using their journal information.</li>"
|
||||
+ " " + i18nStrings.noMatchingMapLocation + "</li>"
|
||||
}
|
||||
|
||||
newErrorMessage += "</ul>";
|
||||
|
|
|
@ -1,4 +1,7 @@
|
|||
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
|
||||
|
||||
$.extend(this, i18nStrings);
|
||||
|
||||
var map;
|
||||
var downloader;
|
||||
var currentVisMode;
|
||||
|
@ -26,7 +29,7 @@ function setupLoadingScreen() {
|
|||
|
||||
$("#" + responseContainerID).block({
|
||||
message: '<div id="loading-data-container"><h3><img id="data-loading-icon" src="' + loadingImageLink
|
||||
+ '" /> Loading data for <i>'
|
||||
+ '" /> ' + i18nStrings.loadingDataFor + ' <i>'
|
||||
+ entityLabel
|
||||
+ '</i></h3></div>'
|
||||
});
|
||||
|
@ -38,8 +41,7 @@ function setupLoadingScreen() {
|
|||
.html('<h3><img id="refresh-page-icon" src="'
|
||||
+ refreshPageImageLink
|
||||
+ '" /> Data for <i>' + entityLabel
|
||||
+ '</i> is now being refreshed. The visualization will load as soon as we are done computing, '
|
||||
+ 'or you can search or browse other data in VIVO and come back in a few minutes.</h3>')
|
||||
+ '</i> ' + i18nStrings.mapBeingRefreshed + '</h3>')
|
||||
.css({'cursor': 'pointer'});
|
||||
}, 10 * 1000);
|
||||
}
|
||||
|
|
|
@ -3,6 +3,9 @@
|
|||
* The MarkerManager is more like a composite class of Marker. It manages
|
||||
* markers by grouping the markers by keys.
|
||||
*/
|
||||
|
||||
$.extend(this, i18nStrings);
|
||||
|
||||
var MarkerManager = Class.extend({
|
||||
init: function() {
|
||||
this.keyToMarker = {};
|
||||
|
@ -184,8 +187,8 @@ var DisciplineMarkerManager = ScimapMarkerManager.extend({
|
|||
marker.setContent(
|
||||
'<div style="font-size: 80%; padding: 5px; text-align: left;"><b>'
|
||||
+ poly.label +'</b><br />'
|
||||
+ addCommasToNumber(poly.value.toFixed(2)) + ' publications (pubs.)<br />'
|
||||
+ (poly.value * 100 / this.maxValue).toFixed(2) + '% activity</div>'
|
||||
+ addCommasToNumber(poly.value.toFixed(2)) + ' ' + i18nStrings.publicationsPubs + '<br />'
|
||||
+ (poly.value * 100 / this.maxValue).toFixed(2) + i18nStrings.percentActivity
|
||||
);
|
||||
return marker;
|
||||
}
|
||||
|
@ -205,8 +208,8 @@ var SubdisciplineMarkerManager = ScimapMarkerManager.extend({
|
|||
marker.setContent(
|
||||
'<div style="font-size: 80%; padding: 5px; text-align: left;"><b>'
|
||||
+ poly.label + '</b> in ' + disciplineLabel +'<br />'
|
||||
+ addCommasToNumber(poly.value.toFixed(2)) + ' publications (pubs.)<br />'
|
||||
+ (poly.value * 100 / this.maxValue).toFixed(2) + '% activity</div>'
|
||||
+ addCommasToNumber(poly.value.toFixed(2)) + ' ' + i18nStrings.publicationsPubs + '<br />'
|
||||
+ (poly.value * 100 / this.maxValue).toFixed(2) + i18nStrings.percentActivity
|
||||
);
|
||||
|
||||
return marker;
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
|
||||
|
||||
$.extend(this, i18nStrings);
|
||||
|
||||
var ScimapWidget = Class.extend({
|
||||
init: function(map) {
|
||||
var me = this;
|
||||
|
@ -48,7 +50,7 @@ var ScimapWidget = Class.extend({
|
|||
me.disciplineLabelsControl = new CheckBoxPanel({
|
||||
map: map,
|
||||
checked: true,
|
||||
text: "Show discipline labels",
|
||||
text: i18nStrings.showDisciplineLabels,
|
||||
click: function() {
|
||||
if($(this).attr('checked')) {
|
||||
me.labelsMarkerManager.showMarkers();
|
||||
|
@ -204,9 +206,9 @@ var ScimapWidget = Class.extend({
|
|||
var length = manager.length();
|
||||
var slider = this.sliderControl;
|
||||
if (this.getMarkerManager(SCIMAP_TYPE.DISCIPLINE) == manager) {
|
||||
slider.setTypeString("disciplines");
|
||||
slider.setTypeString(i18nStrings.disciplinesLower);
|
||||
} else {
|
||||
slider.setTypeString("subdisciplines");
|
||||
slider.setTypeString(i18nStrings.subdisciplinesLower);
|
||||
}
|
||||
slider.setMin(Math.min(1, length));
|
||||
slider.setMax(length);
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
|
||||
|
||||
$.extend(this, i18nStrings);
|
||||
|
||||
var SimpleDataTableWidget = Class.extend({
|
||||
|
||||
dom: {
|
||||
|
@ -61,7 +63,7 @@ var SimpleDataTableWidget = Class.extend({
|
|||
entityVivoProfileURLPrefix + me.uri +'">' +
|
||||
truncateText(me.label, 23) + '</a><a href="' + entityMapOfScienceURLPrefix +
|
||||
me.uri + '"><img class="drillDownIcon" src="' +
|
||||
drillDownIconUrl + '" alt="drill down" title="drill down" /></a></div>');
|
||||
drillDownIconUrl + '" alt="' + i18nStrings.drillDownString + '" title="' + i18nStrings.drillDownString + '" /></a></div>');
|
||||
me.tableDiv.append(organizationHeader);
|
||||
|
||||
/* Create table */
|
||||
|
@ -78,10 +80,10 @@ var SimpleDataTableWidget = Class.extend({
|
|||
|
||||
var scienceAreasTH = $('<th>');
|
||||
scienceAreasTH.attr("id", "entity-science-areas-th");
|
||||
scienceAreasTH.html('Subdisciplines');
|
||||
scienceAreasTH.html(i18nStrings.subdisciplinesString);
|
||||
|
||||
var activityCountTH = $('<th width="53">');
|
||||
activityCountTH.html('# of pubs.');
|
||||
activityCountTH.html('# ' + i18nStrings.numberOfPubs);
|
||||
|
||||
//tr.append(levelOfScienceAreaTH);
|
||||
tr.append(scienceAreasTH);
|
||||
|
@ -129,7 +131,7 @@ var SimpleDataTableWidget = Class.extend({
|
|||
"bFilter": false,
|
||||
"oLanguage": {
|
||||
"sInfo": "_START_ - _END_ of _TOTAL_",
|
||||
"sInfoEmpty": "No matching science areas found",
|
||||
"sInfoEmpty": i18nStrings.noMatchingScienceAreas,
|
||||
"sInfoFiltered": ""
|
||||
},
|
||||
"sPaginationType": "gmail_style",
|
||||
|
@ -140,7 +142,7 @@ var SimpleDataTableWidget = Class.extend({
|
|||
/* Create csv download button */
|
||||
var csvButton = '<hr class="subtle-hr" /><div id="main-science-areas-table-footer" style="background-color:' + me.color + ';"><a href="' +
|
||||
entityMapOfScienceSubDisciplineCSVURLPrefix + me.uri +
|
||||
'" class="map-of-science-links">Save All as CSV</a></div>';
|
||||
'" class="map-of-science-links">' + i18nStrings.saveAllAsCSV + '</a></div>';
|
||||
me.tableDiv.append(csvButton);
|
||||
|
||||
/* Create mapping statistic result */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue