User Tools

Site Tools


server_installation:adding_localizations

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

server_installation:adding_localizations [2009/01/22 12:03] – First cut at enabling / disabling locale (dynamic database labels) support in Evergreen dbsserver_installation:adding_localizations [2022/02/10 13:34] (current) – external edit 127.0.0.1
Line 1: Line 1:
 +====== Enabling and disabling localizations in Evergreen 1.4 ======
 +As of Evergreen 1.4, support for a number of languages beyond American English (**en-US**) is bundled with each release of Evergreen. The translated interfaces are split between static files that are installed with Evergreen and require no effort to enable on your part, and dynamic labels that can be stored in the Evergreen database. Evergreen ships SQL files that contain translated dynamic labels for a number of languages, and to make the set of translated labels available in all interfaces there are a few steps that you must follow. In addition, to disable one or more languages, there are a few steps that you must follow.
  
 +===== Enabling a localization in Evergreen 1.4 =====
 +
 +To enable the translated labels for a given language to display in Evergreen 1.4, you need to populate the database with the translated labels and enable that localization in the Evergreen database. For our example, we will assume that you want to enable Canadian French (**fr-CA**) support in the database. You can reproduce these steps with any of the languages bundled with Evergreen, or create your own localization and add it.
 +  - The translated labels for each locale are stored in SQL files named "950.data.seed-values-xx-YY.sql" where "xx-YY" represents the locale code for the translation. Load the translated labels into the Evergreen database using the ''psql'' command, substituting your database connection information accordingly:<code bash>
 +psql -U <username> -h <hostname> -d <database> -f /path/to/Evergreen-source/Open-ILS/src/sql/Pg/950.data.seed-values-fr-CA.sql</code>
 +  - Ensure the locale is enabled in the Evergreen database. Connect to the database using the ''psql'' utility and check for the existence of the locale in the ''config.i18n_locale'' table:<code sql>
 +SELECT code, marc_code, name, description
 +FROM config.i18n_locale
 +WHERE code = 'fr-CA';</code> 
 +    * If you get one row of output similar to the following, then your locale is already enabled:<code> code  | marc_code |      name         description   
 +-------+-----------+-----------------+-----------------
 + fr-CA | fre       | French (Canada) | Canadian French
 +(1 row)</code>
 +    * On the other hand, if you get zero rows of output as follows, then you will need to enable your locale.<code> code | marc_code | name | description 
 +------+-----------+------+-------------
 +(0 rows)</code> To enable your locale, use ''psql'' insert a row into the ''config.i18n_locale'' table as follows:<code sql>INSERT INTO config.i18n_locale (code, marc_code, name, description)
 +VALUES ('fr-CA', 'fre', 'French (Canada)', 'Canadian French');</code>
 +
 +===== Disabling a localization in Evergreen 1.4 =====
 +You might not want to offer all of the localizations that come preconfigured for Evergreen. If you choose to disable the dynamic labels for a locale, you simply need to delete it from the ''config.i18n_locale'' table using the ''psql'' utility:<code sql>DELETE FROM config.i18n_locale
 +WHERE code = 'fr-CA';</code>

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki

© 2008-2022 GPLS and others. Evergreen is open source software, freely licensed under GNU GPLv2 or later.
The Evergreen Project is a U.S. 501(c)3 non-profit organization.