Difference between revisions of "SUNScholar/Language"

From Libopedia
Jump to navigation Jump to search
m
 
(63 intermediate revisions by the same user not shown)
Line 2: Line 2:
 
  '''[[SUNScholar/Customisation|Back to Customisation]]'''
 
  '''[[SUNScholar/Customisation|Back to Customisation]]'''
 
</center>
 
</center>
 +
==Introduction==
 +
Internationalization localization, requires that the language and locale be configured.
  
;Default
+
==Step 1 - Default Language==
The default language for all services is defined in the "build.properties" and "dspace.cfg" files.
+
Edit the following file:
  https://github.com/DSpace/DSpace/blob/master/build.properties#L40
+
  nano $HOME/{{Source}}/build.properties  
https://github.com/DSpace/DSpace/blob/master/dspace/config/dspace.cfg#L49
+
Go to line 50 and define a language according to: http://www.loc.gov/standards/iso639-2/langhome.html
 +
See example below.
 +
<pre>
 +
# Default language for metadata values
 +
default.language = en_ZA
 +
</pre>
  
;Web UI settings
+
==Step 2 - Default Locale==
Open the the '''dspace.cfg''' file and configure the locale as follows;
+
Edit the following file:
  nano /home/dspace/<u>[[SUNScholar/Install_DSpace/S03#Step_3.2|source]]</u>/dspace/config/dspace.cfg
+
  nano $HOME/{{Source}}/dspace/config/dspace.cfg
Look for the following and configure accordingly ''(define supported locales FIRST, then define the default locale)''.  
+
Go to line 1402 or search for <tt>'''default.locale'''</tt> and define locale according to: http://www.loc.gov/standards/iso639-2/langhome.html
webui.supported.locales = en, en_ZA, de
 
default.locale = en_ZA
 
  
{{NANO}}
+
See example below.
 +
<pre>
 +
### i18n -  Locales / Language ####
 +
# Default Locale
 +
# A Locale in the form country or country_language or country_language_variant
 +
# if no default locale is defined the server default locale will be used.
 +
default.locale = en_ZA
 +
</pre>
  
*'''Remember, check to see if an appropriate language file exists in one the following folders if using the XMLUI;'''
+
==Step 3 - Supported Locales==
  /home/dspace/<u>[[SUNScholar/Install_DSpace/S03#Step_3.2|source]]</u>/dspace-xmlui/src/main/webapp/i18n/
+
Edit the following file:
/home/dspace/<u>[[SUNScholar/Install_DSpace/S03#Step_3.2|source]]</u>/dspace/modules/xmlui/src/main/webapp/i18n/
+
  nano $HOME/{{Source}}/dspace/config/dspace.cfg
 +
Go to line 1402 or search for <tt>'''webui.supported.locales'''</tt> and modify accordingly.
  
;Customisation for the XMLUI Theme
+
See example below.
See: http://wiki.lib.sun.ac.za/index.php/SUNScholar/XMLUI_Theme/Language
+
<pre>
 +
# All the Locales, that are supported by this instance of DSpace
 +
# A comma-separated list of Locales. All types of Locales country, country_language, country_language_variant
 +
# Note that the appropriate file are present, especially that all the Messages_x.properties are there
 +
# may be used, e. g: webui.supported.locales = en, de
 +
webui.supported.locales = en, de, fr, uk, es, bg, ca, el, et, gl, it, ja, pl, ru, tr
 +
</pre>
 +
For each '''"webui.supported.locales"''' a language file must exist, see below for the XMLUI language files customisation.
  
;References
+
==Step 4 - XMLUI Language files customisation==
 +
[[SUNScholar/XMLUI_Theme/Language|Click here]] to modify the language files used by the XMLUI interface.
 +
==Language Metadata Export Fix==
 +
Type the following when connected to the PostgreSQL database;
 +
UPDATE metadatavalue SET text_lang=NULL WHERE text_lang='';
 +
 
 +
==Standards==
 +
For international language standards, see the following:
 +
*[https://en.wikipedia.org/wiki/Locale_(computer_software) Locale]
 +
*[http://www.loc.gov/standards/iso639-2/langhome.html ISO 639.2]
 +
*[http://en.wikipedia.org/wiki/UTF-8 UTF-8]
 +
 
 +
For other metadata standards used see:
 +
http://wiki.lib.sun.ac.za/index.php/SUNScholar/Metadata
 +
 
 +
==References==
 +
*https://wiki.duraspace.org/display/DSDOC5x/Localization+L10n
 
*https://wiki.duraspace.org/display/DSDOC4x/Localization+L10n
 
*https://wiki.duraspace.org/display/DSDOC4x/Localization+L10n
*https://wiki.duraspace.org/display/DSDOC4x/Localization+L10n#LocalizationL10n-Enablingadditionallocales
 
 
*https://wiki.duraspace.org/display/DSDOC3x/Application+Layer#ApplicationLayer-internationalization
 
*https://wiki.duraspace.org/display/DSDOC3x/Application+Layer#ApplicationLayer-internationalization
*https://wiki.duraspace.org/display/DSDOC3x/XMLUI+Configuration+and+Customization#XMLUIConfigurationandCustomization-MultilingualSupport
+
----
*https://wiki.duraspace.org/display/DSDOC18/XMLUI+Configuration+and+Customization#XMLUIConfigurationandCustomization-MultilingualSupport
 
*http://cocoon.apache.org/2.1/userdocs/i18nTransformer.html
 
*https://wiki.duraspace.org/pages/viewpage.action?pageId=19006024
 
*https://wiki.duraspace.org/display/DSPACE/i18n+Improvements+Proposal
 
 
*https://github.com/DSpace/DSpace/blob/master/dspace-api/src/main/java/org/dspace/core/I18nUtil.java
 
*https://github.com/DSpace/DSpace/blob/master/dspace-api/src/main/java/org/dspace/core/I18nUtil.java
*https://github.com/DSpace/DSpace/blob/master/dspace-xmlui/src/main/webapp/i18n/messages.xml
+
[[Category:Customisation]]

Latest revision as of 15:00, 14 September 2016

Back to Customisation

Introduction

Internationalization localization, requires that the language and locale be configured.

Step 1 - Default Language

Edit the following file:

nano $HOME/source/build.properties 

Go to line 50 and define a language according to: http://www.loc.gov/standards/iso639-2/langhome.html

See example below.
# Default language for metadata values
default.language = en_ZA

Step 2 - Default Locale

Edit the following file:

nano $HOME/source/dspace/config/dspace.cfg

Go to line 1402 or search for default.locale and define locale according to: http://www.loc.gov/standards/iso639-2/langhome.html

See example below.

### i18n -  Locales / Language ####
# Default Locale
# A Locale in the form country or country_language or country_language_variant
# if no default locale is defined the server default locale will be used.
default.locale = en_ZA

Step 3 - Supported Locales

Edit the following file:

nano $HOME/source/dspace/config/dspace.cfg

Go to line 1402 or search for webui.supported.locales and modify accordingly.

See example below.

# All the Locales, that are supported by this instance of DSpace
# A comma-separated list of Locales. All types of Locales country, country_language, country_language_variant
# Note that the appropriate file are present, especially that all the Messages_x.properties are there
# may be used, e. g: webui.supported.locales = en, de
webui.supported.locales = en, de, fr, uk, es, bg, ca, el, et, gl, it, ja, pl, ru, tr

For each "webui.supported.locales" a language file must exist, see below for the XMLUI language files customisation.

Step 4 - XMLUI Language files customisation

Click here to modify the language files used by the XMLUI interface.

Language Metadata Export Fix

Type the following when connected to the PostgreSQL database;

UPDATE metadatavalue SET text_lang=NULL WHERE text_lang=;

Standards

For international language standards, see the following:

For other metadata standards used see:

http://wiki.lib.sun.ac.za/index.php/SUNScholar/Metadata

References