diff --git a/doc/install.html b/doc/install.html index fa84c616..5c886d7b 100644 --- a/doc/install.html +++ b/doc/install.html @@ -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. @@ -712,6 +712,82 @@ + + + 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. + + + + + languages.selectableLocales + + + en, es, fr_FR + + + + + + For developers only. + 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 false, which + means that a cached copy of each template will be used for 60 seconds + before the disk is checked for a new version. +
Setting this option to "true" slows down VIVO performance. + + + + + developer.defeatFreemarkerCache + + + false + + + + + + For developers only. + 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 false, which means that the language file is + read when VIVO starts up, or when a new theme is selected. +
Setting this option to "true" slows down VIVO performance. + + + + + developer.defeatI18nCache = true + + + false + + + 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. - OpenSocial.shindigURL
diff --git a/doc/upgrade-1.6.html b/doc/upgrade-1.6.html index 8a8874b0..99ff010e 100644 --- a/doc/upgrade-1.6.html +++ b/doc/upgrade-1.6.html @@ -232,10 +232,16 @@
+

If you prefer, you may start with example.build.properties and example.runtime.properties, make copies, and edit them to suit your installation. - +

+ +

+ The properties below are new to runtime.properties. They are optional, + so you need not add them, unless you want a value other than the default. +

@@ -249,19 +255,83 @@ Example Value + - 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. - BOGUS.PROPERTYNAME + languages.forceLocale - BOGUS EXAMPLE VALUE + 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. + + + + + languages.selectableLocales + + + en, es, fr_FR + + + + + + For developers only. + 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 false, which + means that a cached copy of each template will be used for 60 seconds + before the disk is checked for a new version. +
Setting this option to "true" slows down VIVO performance. + + + + + developer.defeatFreemarkerCache + + + false + + + + + + For developers only. + 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 false, which means that the language file is + read when VIVO starts up, or when a new theme is selected. +
Setting this option to "true" slows down VIVO performance. + + + + + developer.defeatI18nCache = true + + + false + + + diff --git a/example.runtime.properties b/example.runtime.properties index ce7c74ba..8155b2c8 100644 --- a/example.runtime.properties +++ b/example.runtime.properties @@ -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 false, 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 +# false, 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 diff --git a/productMods/WEB-INF/ontologies/app/loadedAtStartup/localeSelectionGUI.n3 b/productMods/WEB-INF/ontologies/app/loadedAtStartup/localeSelectionGUI.n3 new file mode 100644 index 00000000..8a81aa25 --- /dev/null +++ b/productMods/WEB-INF/ontologies/app/loadedAtStartup/localeSelectionGUI.n3 @@ -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: . + + display:hasDataGetter display:localeSelectorDataGetter . + +display:localeSelectorDataGetter + a . diff --git a/productMods/WEB-INF/resources/startup_listeners.txt b/productMods/WEB-INF/resources/startup_listeners.txt index 300f7020..f097b3bd 100644 --- a/productMods/WEB-INF/resources/startup_listeners.txt +++ b/productMods/WEB-INF/resources/startup_listeners.txt @@ -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 diff --git a/productMods/WEB-INF/web.xml b/productMods/WEB-INF/web.xml index 68c2e25a..ff022163 100644 --- a/productMods/WEB-INF/web.xml +++ b/productMods/WEB-INF/web.xml @@ -81,6 +81,16 @@ /* + + Override the Locale in the HttpRequest, if appropriate. + Locale selection filter + edu.cornell.mannlib.vitro.webapp.i18n.selection.LocaleSelectionFilter + + + Locale selection filter + /* + + JSession Strip Filter edu.cornell.mannlib.vitro.webapp.filters.JSessionStripFilter @@ -1401,6 +1411,16 @@ /orng/* + + Multiple-language support. Allows user to select his preferred langauge + LocaleSelectionController + edu.cornell.mannlib.vitro.webapp.i18n.selection.LocaleSelectionController + + + LocaleSelectionController + /selectLocale + + diff --git a/themes/wilma/i18n/images/select_locale_en.GIF b/themes/wilma/i18n/images/select_locale_en.GIF new file mode 100644 index 00000000..b42e9a41 Binary files /dev/null and b/themes/wilma/i18n/images/select_locale_en.GIF differ diff --git a/themes/wilma/i18n/images/select_locale_es.GIF b/themes/wilma/i18n/images/select_locale_es.GIF new file mode 100644 index 00000000..65ccaf74 Binary files /dev/null and b/themes/wilma/i18n/images/select_locale_es.GIF differ diff --git a/themes/wilma/i18n/images/select_locale_fr.GIF b/themes/wilma/i18n/images/select_locale_fr.GIF new file mode 100644 index 00000000..7a80e91a Binary files /dev/null and b/themes/wilma/i18n/images/select_locale_fr.GIF differ diff --git a/themes/wilma/templates/identity.ftl b/themes/wilma/templates/identity.ftl index 70ae1f51..07910b24 100644 --- a/themes/wilma/templates/identity.ftl +++ b/themes/wilma/templates/identity.ftl @@ -9,6 +9,7 @@