Merge pull request #355 from vivo-project/i18n-redesign

I18n redesign
This commit is contained in:
Dragan Ivanovic 2023-02-13 14:08:01 +01:00 committed by GitHub
commit 48c88d3d3e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
110 changed files with 52884 additions and 1421 deletions

View file

@ -21,6 +21,7 @@ edu.cornell.mannlib.vitro.webapp.config.RevisionInfoSetup
edu.cornell.mannlib.vitro.webapp.email.FreemarkerEmailFactory$Setup
edu.cornell.mannlib.vitro.webapp.i18n.selection.LocaleSelectionSetup
edu.cornell.mannlib.vitro.webapp.servlet.setup.ConfigurationModelsSetup
edu.cornell.mannlib.vitro.webapp.servlet.setup.ContentModelSetup
@ -51,7 +52,7 @@ edu.cornell.mannlib.vitro.webapp.services.shortview.ShortViewServiceSetup
edu.ucsf.vitro.opensocial.OpenSocialSmokeTests
# For multiple language support
edu.cornell.mannlib.vitro.webapp.i18n.selection.LocaleSelectionSetup
edu.cornell.mannlib.vitro.webapp.i18n.I18nContextListener
# The search indexer uses a "public" permission, so the PropertyRestrictionPolicyHelper
# and the PermissionRegistry must already be set up.

View file

@ -0,0 +1,8 @@
Please note that although usage of property files for translation of UI labels is supported at the moment,
it is deprecated and not recommended. Please, consider using ontology instead of property file located at:
Source code: [VIVO project]Vitro/home/src/main/resources/rdf/i18n/de_DE/interface-i18n/firsttime/vitro_UiLabel_de_DE.ttl
Deployment: [VIVO home]/rdf/i18n/de_DE/display/interface-i18n/vitro_UiLabel_de_DE.ttl
However, if you decide to use property files, please create and post the file in the same
directory as this Readme file.

View file

@ -0,0 +1,8 @@
Please note that although usage of property files for translation of UI labels is supported at the moment,
it is deprecated and not recommended. Please, consider using ontology instead of property file located at:
Source code: [VIVO project]Vitro/home/src/main/resources/rdf/i18n/en_CA/interface-i18n/firsttime/vitro_UiLabel_en_CA.ttl
Deployment: [VIVO home]/rdf/i18n/en_CA/display/interface-i18n/vitro_UiLabel_en_CA.ttl
However, if you decide to use property files, please create and post the file in the same
directory as this Readme file.

View file

@ -0,0 +1,8 @@
Please note that although usage of property files for translation of UI labels is supported at the moment,
it is deprecated and not recommended. Please, consider using ontology instead of property file located at:
Source code: [VIVO project]Vitro/home/src/main/resources/rdf/i18n/en_US/interface-i18n/firsttime/vitro_UiLabel_en_US.ttl
Deployment: [VIVO home]/rdf/i18n/en_US/display/interface-i18n/vitro_UiLabel_en_US.ttl
However, if you decide to use property files, please create and post the file in the same
directory as this Readme file.

View file

@ -0,0 +1,8 @@
Please note that although usage of property files for translation of UI labels is supported at the moment,
it is deprecated and not recommended. Please, consider using ontology instead of property file located at:
Source code: [VIVO project]Vitro/home/src/main/resources/rdf/i18n/es/interface-i18n/firsttime/vitro_UiLabel_es.ttl
Deployment: [VIVO home]/rdf/i18n/es/display/interface-i18n/vitro_UiLabel_es.ttl
However, if you decide to use property files, please create and post the file in the same
directory as this Readme file.

View file

@ -0,0 +1,8 @@
Please note that although usage of property files for translation of UI labels is supported at the moment,
it is deprecated and not recommended. Please, consider using ontology instead of property file located at:
Source code: [VIVO project]Vitro/home/src/main/resources/rdf/i18n/fr_CA/interface-i18n/firsttime/vitro_UiLabel_fr_CA.ttl
Deployment: [VIVO home]/rdf/i18n/fr_CA/display/interface-i18n/vitro_UiLabel_fr_CA.ttl
However, if you decide to use property files, please create and post the file in the same
directory as this Readme file.

View file

@ -0,0 +1,8 @@
Please note that although usage of property files for translation of UI labels is supported at the moment,
it is deprecated and not recommended. Please, consider using ontology instead of property file located at:
Source code: [VIVO project]Vitro/home/src/main/resources/rdf/i18n/pt_BR/interface-i18n/firsttime/vitro_UiLabel_pt_BR.ttl
Deployment: [VIVO home]/rdf/i18n/pt_BR/display/interface-i18n/vitro_UiLabel_pt_BR.ttl
However, if you decide to use property files, please create and post the file in the same
directory as this Readme file.

View file

@ -0,0 +1,8 @@
Please note that although usage of property files for translation of UI labels is supported at the moment,
it is deprecated and not recommended. Please, consider using ontology instead of property file located at:
Source code: [VIVO project]Vitro/home/src/main/resources/rdf/i18n/ru_RU/interface-i18n/firsttime/vitro_UiLabel_ru_RU.ttl
Deployment: [VIVO home]/rdf/i18n/ru_RU/display/interface-i18n/vitro_UiLabel_ru_RU.ttl
However, if you decide to use property files, please create and post the file in the same
directory as this Readme file.

View file

@ -0,0 +1,8 @@
Please note that although usage of property files for translation of UI labels is supported at the moment,
it is deprecated and not recommended. Please, consider using ontology instead of property file located at:
Source code: [VIVO project]Vitro/home/src/main/resources/rdf/i18n/sr_Latn_RS/interface-i18n/firsttime/vitro_UiLabel_sr_Latn_RS.ttl
Deployment: [VIVO home]/rdf/i18n/sr_Latn_RS/display/interface-i18n/vitro_UiLabel_sr_Latn_RS.ttl
However, if you decide to use property files, please create and post the file in the same
directory as this Readme file.

View file

@ -71,6 +71,51 @@
</td>
</tr>
<tr><td colspan="3"><hr/></td></tr>
<!-- _____________________________________________ faux properties __________________________________________ -->
<tr valign="bottom" align="center">
<td colspan="2" valign="bottom" align="left">
<c:if test="${!empty fauxproperties}">
<c:forEach var="fauxproperty" items="${fauxproperties}">
<ul style="list-style-type:none;">
<li>
<c:choose>
<c:when test="${empty fauxproperty.domainLabel}">
<c:url var="fauxpropertyURL" value="editForm">
<c:param name="controller" value="FauxProperty"/>
<c:param name="baseUri" value="${datatypeProperty.URI}"/>
<c:param name="rangeUri" value="${fauxproperty.rangeURI}" />
</c:url>
<a href="${fauxpropertyURL}">${fauxproperty.pickListName}</a>
no domain,
</c:when>
<c:otherwise>
<c:url var="fauxpropertyURL" value="editForm">
<c:param name="controller" value="FauxProperty"/>
<c:param name="baseUri" value="${datatypeProperty.URI}"/>
<c:param name="domainUri" value="${fauxproperty.domainURI}" />
<c:param name="rangeUri" value="${fauxproperty.rangeURI}" />
</c:url>
<a href="${fauxpropertyURL}">${fauxproperty.pickListName}</a>
domain: ${fauxproperty.domainLabel},
</c:otherwise>
</c:choose>
range: ${fauxproperty.rangeLabel}
</li>
</ul>
</c:forEach>
</c:if>
</td>
<td>
<form action="editForm" method="get">
<input type="hidden" name="create" value="create"/>
<input type="hidden" name="baseUri" value="${datatypeProperty.URI}"/>
<input type="hidden" name="controller" value="FauxProperty"/>
<input type="submit" class="form-button" value="Create New Faux Property"/>
</form>
</td>
</tr>
<tr><td colspan="3"><hr/></td></tr>
<!-- _____________________________________________ superproperties __________________________________________ -->
<tr valign="bottom" align="center">

View file

@ -1,62 +0,0 @@
<#-- $This file is distributed under the terms of the license in LICENSE$ -->
<#-- Template for email message sent to site administrator when an error occurs on the site. -->
<#assign subject = "${i18n().error_occurred(siteName!)}" />
<#assign datetime = datetime?string("yyyy-MM-dd HH:mm:ss zzz")>
<#assign html>
<html>
<head>
<title>${subject!}</title>
</head>
<body>
<p>
${i18n().error_occurred_at(siteName!,datetime!)}
</p>
<p>
<strong>${i18n().requested_url}:</strong> ${requestedUrl!}
</p>
<p>
<#if errorMessage?has_content>
<strong>${i18n().error_message}:</strong> ${errorMessage!}
</#if>
</p>
<p>
<strong>${i18n().stack_trace}</strong> (${i18n().trace_available(siteName!)}):
<pre>${stackTrace!}</pre>
</p>
<#if cause?has_content>
<p><strong>${i18n().caused_by}:</strong>
<pre>${cause!}</pre>
</p>
</#if>
</body>
</html>
</#assign>
<#assign text>
${i18n().error_occurred_at(siteName!,datetime!)}
${i18n().requested_url}: ${requestedUrl!}
<#if errorMessage?has_content>
${i18n().error_message}: ${errorMessage!}
</#if>
${i18n().stack_trace} (${i18n().trace_available(siteName!)}):
${stackTrace!}
<#if cause?has_content>
${i18n().caused_by}:
${cause!}
</#if>
</#assign>
<@email subject=subject html=html text=text />

View file

@ -40,7 +40,7 @@
<tbody>
<tr>
<td class="classDetail">${i18n().base_property_capitalized}:</td>
<td><a href='propertyEdit?uri=${ks["baseURI"]?url!}'>${ks["base"]!}</a></td>
<td><a href='${ks["editUrl"]}?uri=${ks["baseURI"]?url!}'>${ks["base"]!}</a></td>
</tr>
<tr>
<td class="classDetail">${i18n().group_capitalized}:</td>
@ -66,12 +66,13 @@
<#assign baseLabel = key?substring(0,key?index_of("|")) />
<#assign baseUri = key?substring(key?index_of("|")+1) />
<div>
<a href='propertyEdit?uri=${baseUri?url}'>${baseLabel}</a>
<a href='${fauxList["editUrl"]}?uri=${baseUri?url}'>${baseLabel}</a>
</div>
<#assign keysTwo = fauxList?keys />
<#assign firstLoop = true />
<#list keysTwo as k2>
<#assign faux = fauxList[k2] />
<#if faux?is_hash >
<table id="classHierarchy1" class="classHierarchy" <#if !firstLoop >style="margin-top:-16px"</#if>>
<tbody>
<tr>
@ -94,6 +95,7 @@
</tbody>
</table>
<#assign firstLoop = false />
</#if>
</#list>
</section>
</#list>

View file

@ -58,7 +58,7 @@
<#---This section should become autocomplete instead-->
<p>
<label for="object"> ${propertyNameForDisplay?capitalize} ${i18n().name_capitalized}<span class='requiredHint'> *</span></label>
<label for="object"> ${i18n().name_capitalized?cap_first} <span class='requiredHint'> *</span></label>
<input class="acSelector" size="50" type="text" id="object" name="objectLabel" acGroupName="object" value="${objectLabel}" />
</p>
@ -109,23 +109,23 @@ Also multiple types parameter set to true only if more than one type returned-->
var customFormData = {
acUrl: '${urls.base}/autocomplete?tokenize=true',
<#if objectTypesExist = true>
acTypes: {object: '${objectTypes}'},
acTypes: {object: '${objectTypes?js_string}'},
</#if>
<#if multipleTypes = true>
acMultipleTypes: 'true',
</#if>
editMode: '${editMode}',
typeName:'${propertyNameForDisplay}',
typeName:'${propertyNameForDisplay?js_string}',
acSelectOnly: 'true',
sparqlForAcFilter: '${sparqlForAcFilter}',
sparqlQueryUrl: '${sparqlQueryUrl}',
acFilterForIndividuals: ${acFilterForIndividuals},
defaultTypeName: '${propertyNameForDisplay}', // used in repair mode to generate button text
sparqlForAcFilter: '${sparqlForAcFilter?js_string}',
sparqlQueryUrl: '${sparqlQueryUrl?js_string}',
acFilterForIndividuals: ${acFilterForIndividuals?js_string},
defaultTypeName: '${propertyNameForDisplay?js_string}', // used in repair mode to generate button text
baseHref: '${urls.base}/individual?uri='
};
var i18nStrings = {
selectAnExisting: '${i18n().select_an_existing?js_string}',
orCreateNewOne: '${i18n().or_create_new_one?js_string}',
selectAnExistingOrCreateNewOne: '${i18n().select_an_existing_or_create_a_new_one?js_string}',
selectedString: '${i18n().selected?js_string}'
};
</script>

View file

@ -1,7 +1,7 @@
<#-- $This file is distributed under the terms of the license in LICENSE$ -->
<#assign formTitle>
"${editConfiguration.propertyPublicDomainTitle}" entry for ${editConfiguration.subjectName}
${i18n().new_entry_for(editConfiguration.propertyPublicDomainTitle, editConfiguration.subjectName)}
</#assign>
<#if editConfiguration.objectUri?has_content>
<#assign formTitle>${i18n().edit_capitalized} ${formTitle} </#assign>

View file

@ -644,7 +644,8 @@ var customForm = {
if ( this.templateDefinedAcTypes && !this.defaultAcType.length ) {
this.defaultAcType = this.acTypes[acTypeKey];
}
if (selectedType.val().length) {
var selectedTypeLength = selectedType.val().length;
if ( selectedTypeLength !== 'undefined') {
this.acTypes[acTypeKey] = selectedType.val();
this.typeName = selectedType.html();
if ( this.editMode == 'edit' ) {
@ -709,10 +710,10 @@ var customForm = {
// 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) == customForm.selectAnExisting ) {
typeText = this.getTypeNameForLabels($(selectedObj));
var helpText = customForm.selectAnExisting + " " + typeText + " " + customForm.orCreateNewOne ;
var helpText = customForm.selectAnExistingOrCreateNewOne ;
//Different for object property autocomplete
if ( this.acSelectOnly ) {
helpText = customForm.selectAnExisting + " " + typeText;
helpText = customForm.selectAnExisting;
}
$(selectedObj).val(helpText)
.addClass(this.acHelpTextClass);
@ -758,5 +759,9 @@ var customForm = {
};
$(document).ready(function() {
customForm.onLoad();
try{
customForm.onLoad();
} catch(error){
console.log(error.message);
}
});

View file

@ -11,7 +11,8 @@
</#if>
<h2>${i18n().create_new} ${typeName}</h2>
<h2>${i18n().create_new_individual_of_the_following_type}</h2>
<h2>"${typeName}"</h2>
<#if submissionErrors?has_content >
<section id="error-alert" role="alert">
@ -42,7 +43,7 @@
<p class="submit">
<input type="hidden" name = "editKey" value="${editKey}"/>
<input type="submit" id="submit" value="${i18n().create_capitalized} ${typeName}"/>
<input type="submit" id="submit" value="${i18n().create_capitalized}"/>
<span class="or"> or <a class="cancel" href="${urls.base}/siteAdmin" title="${i18n().cancel_title}">${i18n().cancel_link}</a>
</p>

View file

@ -149,7 +149,7 @@ name will be used as the label. -->
<a class="add-${propertyLocalName}" href="${url}" title="${i18n().manage_list_of} ${label?lower_case}">
<img class="add-individual" data-domain="${domainUri}" data-range="${rangeUri}" src="${urls.images}/individual/manage-icon.png" alt="${i18n().manage}" /></a>
<#else>
<a class="add-${propertyLocalName}" href="${url}" title="${i18n().add_new} ${label?lower_case} ${i18n().entry}">
<a class="add-${propertyLocalName}" href="${url}" title="${i18n().add_new_entry_for} ${label?lower_case}">
<img class="add-individual" data-domain="${domainUri}" data-range="${rangeUri}" src="${urls.images}/individual/addIcon.gif" alt="${i18n().add}" /></a>
</#if>
</#macro>
@ -353,5 +353,5 @@ name will be used as the label. -->
</#function>
<#function capitalizeGroupName propertyGroupName>
<#return propertyGroupName?capitalize>
<#return propertyGroupName?cap_first>
</#function>

View file

@ -6,7 +6,7 @@
<#list selectLocale.locales as locale>
<li <#if locale.selected>status="selected"</#if>>
<a href="${selectLocale.selectLocaleUrl}?selection=${locale.code}" title="${i18n().select_locale} -- ${locale.label}">${locale.label?capitalize}<#if locale.country?has_content> (${locale.country})</#if></a>
<a href="${selectLocale.selectLocaleUrl}?selection=${locale.code}" title="${i18n().select_locale} -- ${locale.label}">${locale.label?capitalize}<#if locale.country?has_content> (${locale.country})</#if><#if locale.institution?has_content> - ${locale.institution}</#if></a>
</li>
</#list>
</ul>
@ -21,6 +21,7 @@
* -- code
* -- label (tooltip displayed in original locale, not current locale)
* -- country (displayed in original locale, not current locale)
* -- institution (abbreviation)
* -- selected (boolean)
-->
<script type="text/javascript">

View file

@ -0,0 +1,42 @@
<#-- $This file is distributed under the terms of the license in /doc/license.txt$ -->
<#if origination?has_content && origination == "helpLink">
<h2>${i18n().search_tips_header}</h2>
<span id="searchHelp">
<a href="#" onClick="history.back();return false;" title="${i18n().back_to_results}">${i18n().back_to_results}</a>
</span>
<#else>
<h3>${i18n().search_tips_header}</h3>
</#if>
<ul class="searchTips">
<li>${i18n().search_tip_one}</li>
<li>${i18n().search_tip_two}</li>
<li>${i18n().search_tip_three}</li>
<li>${i18n().search_tip_four}</li>
</ul>
<h4><a id="advTipsLink" href="#">${i18n().advanced_search_tips_header}</a></h4>
<ul id="advanced" class="searchTips" style="visibility:hidden">
<li>${i18n().advanced_search_tip_one}</li>
<li>${i18n().advanced_search_tip_two}</li>
<li>${i18n().advanced_search_tip_three}</li>
<li>${i18n().advanced_search_tip_four}</li>
<li>${i18n().advanced_search_tip_five}</li>
<li>${i18n().advanced_search_tip_six}</li>
</ul>
<a id="closeLink" href="#" style="visibility:hidden;font-size:.825em;padding-left:8px">${i18n().close_capitalized}</a>
${stylesheets.add('<link rel="stylesheet" href="${urls.base}/css/search.css" />')}
<script type="text/javascript">
$(document).ready(function(){
$('a#advTipsLink').click(function() {
$('ul#advanced').css("visibility","visible");
$('a#closeLink').css("visibility","visible");
$('a#closeLink').click(function() {
$('ul#advanced').css("visibility","hidden");
$('a#closeLink').css("visibility","hidden");
});
});
});
</script>