VIVO-12 NIHVIVO-4011 Provide config and GUI for selecting Locale
This commit is contained in:
parent
89f759fcbc
commit
a3bd67097b
11 changed files with 230 additions and 7 deletions
|
@ -305,7 +305,7 @@
|
|||
Directory where the VIVO application will store
|
||||
the data that it creates. This includes uploaded files (usually images)
|
||||
and the Solr search index. Be sure this directory exists and is
|
||||
writable by the user who the Tomcat service is running as.
|
||||
writable by the Tomcat service.
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="odd_row">
|
||||
|
@ -712,6 +712,82 @@
|
|||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
Force VIVO to use a specific language or Locale instead of those
|
||||
specified by the browser.
|
||||
This affects RDF data retrieved from the model, if RDFService.languageFilter is true.
|
||||
This also affects the text of pages that have been modified to support multiple languages.
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="odd_row">
|
||||
<td>
|
||||
languages.forceLocale
|
||||
</td>
|
||||
<td>
|
||||
en_US
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
A list of supported languages or Locales that the user may choose to
|
||||
use instead of the one specified by the browser. Selection images must
|
||||
be available in the i18n/images directory of the theme.
|
||||
This affects RDF data retrieved from the model, if RDFService.languageFilter is true.
|
||||
This also affects the text of pages that have been modified to support multiple languages.
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="odd_row">
|
||||
<td>
|
||||
languages.selectableLocales
|
||||
</td>
|
||||
<td>
|
||||
en, es, fr_FR
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<b>For developers only.</b>
|
||||
Defeat the Freemarker template cache, so each template
|
||||
is read from disk on each request. This permits developers to immediately
|
||||
see the effect of changes to the template. The default is <code>false</code>, which
|
||||
means that a cached copy of each template will be used for 60 seconds
|
||||
before the disk is checked for a new version.
|
||||
<br/><b>Setting this option to "true" slows down VIVO performance.</b>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="odd_row">
|
||||
<td>
|
||||
developer.defeatFreemarkerCache
|
||||
</td>
|
||||
<td>
|
||||
false
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<b>For developers only.</b>
|
||||
Defeat the cache of language-specific text strings,
|
||||
so the language file is read from disk on each request.
|
||||
This permits developers to immediately
|
||||
see the effect of changes to the text strings.
|
||||
The default is <code>false</code>, which means that the language file is
|
||||
read when VIVO starts up, or when a new theme is selected.
|
||||
<br/><b>Setting this option to "true" slows down VIVO performance.</b>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="odd_row">
|
||||
<td>
|
||||
developer.defeatI18nCache = true
|
||||
</td>
|
||||
<td>
|
||||
false
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
These values are used when deploying VIVO as an OpenSocial container
|
||||
|
@ -720,7 +796,6 @@
|
|||
a VIVO installation that does not use OpenSocial gadgets, these values are omitted.
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr class="odd_row">
|
||||
<td>
|
||||
OpenSocial.shindigURL<br>
|
||||
|
|
|
@ -232,10 +232,16 @@
|
|||
</tbody>
|
||||
</table>
|
||||
<br>
|
||||
<p>
|
||||
If you prefer, you may start with <code>example.build.properties</code>
|
||||
and <code>example.runtime.properties</code>, make copies,
|
||||
and edit them to suit your installation.
|
||||
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The properties below are new to <code>runtime.properties</code>. They are optional,
|
||||
so you need not add them, unless you want a value other than the default.
|
||||
</p>
|
||||
<p>
|
||||
<!-- runtime.properties table from install.html -->
|
||||
</p>
|
||||
|
@ -249,19 +255,83 @@
|
|||
Example Value
|
||||
</th>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
BOGUS: ANY NEW PROPERTIES TO ADD?
|
||||
Force VIVO to use a specific language or Locale instead of those
|
||||
specified by the browser.
|
||||
This affects RDF data retrieved from the model, if RDFService.languageFilter is true.
|
||||
This also affects the text of pages that have been modified to support multiple languages.
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="odd_row blue">
|
||||
<td>
|
||||
BOGUS.PROPERTYNAME
|
||||
languages.forceLocale
|
||||
</td>
|
||||
<td>
|
||||
BOGUS EXAMPLE VALUE
|
||||
en_US
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
A list of supported languages or Locales that the user may choose to
|
||||
use instead of the one specified by the browser. Selection images must
|
||||
be available in the i18n/images directory of the theme.
|
||||
This affects RDF data retrieved from the model, if RDFService.languageFilter is true.
|
||||
This also affects the text of pages that have been modified to support multiple languages.
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="odd_row blue">
|
||||
<td>
|
||||
languages.selectableLocales
|
||||
</td>
|
||||
<td>
|
||||
en, es, fr_FR
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<b>For developers only.</b>
|
||||
Defeat the Freemarker template cache, so each template
|
||||
is read from disk on each request. This permits developers to immediately
|
||||
see the effect of changes to the template. The default is <code>false</code>, which
|
||||
means that a cached copy of each template will be used for 60 seconds
|
||||
before the disk is checked for a new version.
|
||||
<br/><b>Setting this option to "true" slows down VIVO performance.</b>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="odd_row blue">
|
||||
<td>
|
||||
developer.defeatFreemarkerCache
|
||||
</td>
|
||||
<td>
|
||||
false
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<b>For developers only.</b>
|
||||
Defeat the cache of language-specific text strings,
|
||||
so the language file is read from disk on each request.
|
||||
This permits developers to immediately
|
||||
see the effect of changes to the text strings.
|
||||
The default is <code>false</code>, which means that the language file is
|
||||
read when VIVO starts up, or when a new theme is selected.
|
||||
<br/><b>Setting this option to "true" slows down VIVO performance.</b>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="odd_row blue">
|
||||
<td>
|
||||
developer.defeatI18nCache = true
|
||||
</td>
|
||||
<td>
|
||||
false
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
|
|
@ -159,6 +159,48 @@ proxy.eligibleTypeList = http://xmlns.com/foaf/0.1/Person, http://xmlns.com/foaf
|
|||
#
|
||||
RDFService.languageFilter = true
|
||||
|
||||
#
|
||||
# Force VIVO to use a specific language or Locale instead of those
|
||||
# specified by the browser. This affects RDF data retrieved from the model,
|
||||
# if RDFService.languageFilter is true. This also affects the text of pages
|
||||
# that have been modified to support multiple languages.
|
||||
#
|
||||
# languages.forceLocale = en_US
|
||||
|
||||
#
|
||||
# A list of supported languages or Locales that the user may choose to
|
||||
# use instead of the one specified by the browser. Selection images must
|
||||
# be available in the i18n/images directory of the theme. This affects
|
||||
# RDF data retrieved from the model, if RDFService.languageFilter is true.
|
||||
# This also affects the text of pages that have been modified to support
|
||||
# multiple languages.
|
||||
#
|
||||
# This should not be used with languages.forceLocale, which will override it.
|
||||
#
|
||||
# languages.selectableLocales = en, es, fr
|
||||
|
||||
#
|
||||
# For developers only: Setting this option to "true" slows down VIVO performance.
|
||||
#
|
||||
# Defeat the Freemarker template cache, so each template is read from disk
|
||||
# on each request. This permits developers to immediately see the effect of
|
||||
# changes to the template. The default is <code>false</code>, which means
|
||||
# that a cached copy of each template will be used for 60 seconds before
|
||||
# the disk is checked for a new version.
|
||||
#
|
||||
# developer.defeatFreemarkerCache = true
|
||||
|
||||
#
|
||||
# For developers only: Setting this option to "true" slows down VIVO performance.
|
||||
#
|
||||
# Defeat the cache of language-specific text strings, so the language file
|
||||
# is read from disk on each request. This permits developers to immediately
|
||||
# see the effect of changes to the text strings. The default is
|
||||
# <code>false</code>, which means that the language file is read when
|
||||
# VIVO starts up, or when a new theme is selected.
|
||||
#
|
||||
# developer.defeatI18nCache = true
|
||||
|
||||
#
|
||||
# For OpenSocial integration
|
||||
# The base URL of the ORNG Shindig server. Usually, this is the same host and port
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
# $This file is distributed under the terms of the license in /doc/license.txt$
|
||||
|
||||
#
|
||||
# Associate the LocaleSelectionDataGetter with the languageSelector.ftl Freemarker template.
|
||||
#
|
||||
|
||||
@prefix display: <http://vitro.mannlib.cornell.edu/ontologies/display/1.1#> .
|
||||
|
||||
<freemarker:languageSelector.ftl> display:hasDataGetter display:localeSelectorDataGetter .
|
||||
|
||||
display:localeSelectorDataGetter
|
||||
a <java:edu.cornell.mannlib.vitro.webapp.i18n.selection.LocaleSelectionDataGetter> .
|
|
@ -59,6 +59,9 @@ 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
|
||||
|
||||
# Add VIVO specific DocumentModifers, this must come before SolrSetup
|
||||
edu.cornell.mannlib.vitro.webapp.search.solr.VivoDocumentModifiers
|
||||
|
||||
|
|
|
@ -81,6 +81,16 @@
|
|||
<url-pattern>/*</url-pattern>
|
||||
</filter-mapping>
|
||||
|
||||
<filter>
|
||||
<description>Override the Locale in the HttpRequest, if appropriate.</description>
|
||||
<filter-name>Locale selection filter</filter-name>
|
||||
<filter-class>edu.cornell.mannlib.vitro.webapp.i18n.selection.LocaleSelectionFilter</filter-class>
|
||||
</filter>
|
||||
<filter-mapping>
|
||||
<filter-name>Locale selection filter</filter-name>
|
||||
<url-pattern>/*</url-pattern>
|
||||
</filter-mapping>
|
||||
|
||||
<filter>
|
||||
<filter-name>JSession Strip Filter</filter-name>
|
||||
<filter-class>edu.cornell.mannlib.vitro.webapp.filters.JSessionStripFilter</filter-class>
|
||||
|
@ -1401,6 +1411,16 @@
|
|||
<url-pattern>/orng/*</url-pattern>
|
||||
</servlet-mapping>
|
||||
|
||||
<servlet>
|
||||
<description>Multiple-language support. Allows user to select his preferred langauge</description>
|
||||
<servlet-name>LocaleSelectionController</servlet-name>
|
||||
<servlet-class>edu.cornell.mannlib.vitro.webapp.i18n.selection.LocaleSelectionController</servlet-class>
|
||||
</servlet>
|
||||
<servlet-mapping>
|
||||
<servlet-name>LocaleSelectionController</servlet-name>
|
||||
<url-pattern>/selectLocale</url-pattern>
|
||||
</servlet-mapping>
|
||||
|
||||
|
||||
<!-- ============================== servlet-mappings ======================== -->
|
||||
<servlet-mapping>
|
||||
|
|
BIN
themes/wilma/i18n/images/select_locale_en.GIF
Normal file
BIN
themes/wilma/i18n/images/select_locale_en.GIF
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.5 KiB |
BIN
themes/wilma/i18n/images/select_locale_es.GIF
Normal file
BIN
themes/wilma/i18n/images/select_locale_es.GIF
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.2 KiB |
BIN
themes/wilma/i18n/images/select_locale_fr.GIF
Normal file
BIN
themes/wilma/i18n/images/select_locale_fr.GIF
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.1 KiB |
|
@ -9,6 +9,7 @@
|
|||
|
||||
<nav role="navigation">
|
||||
<ul id="header-nav" role="list">
|
||||
<#include "languageSelector.ftl">
|
||||
<li role="listitem"><a href="${urls.index}" title="index">Index</a></li>
|
||||
<#if user.loggedIn>
|
||||
<#-- COMMENTING OUT THE EDIT PAGE LINK FOR RELEASE 1.5. WE NEED TO IMPLEMENT THIS IN A MORE
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<nav role="navigation">
|
||||
<ul id="main-nav" role="list">
|
||||
<#list menu.items as item>
|
||||
<li role="listitem"><a href="${item.url}" title="menu item" <#if item.active> class="selected" </#if>>${item.linkText}</a></li>
|
||||
<li role="listitem"><a href="${item.url}" title="${item.linkText} menu item" <#if item.active> class="selected" </#if>>${item.linkText}</a></li>
|
||||
</#list>
|
||||
</ul>
|
||||
</nav>
|
||||
|
|
Loading…
Add table
Reference in a new issue