8ba7edf19debb13ea684e9774400ecab68b0c247
[working/Evergreen.git] / 1.6 / admin / localization.xml
1 <?xml version="1.0" encoding="UTF-8"?>\r
2 <chapter xml:id="languagesandlocalization" xmlns="http://docbook.org/ns/docbook" xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:xl="http://www.w3.org/1999/xlink">\r
3 <info>\r
4 <title>Languages and Localization</title>\r
5 </info>\r
6 <section xml:id="enabling_and_disabling_localization">                  \r
7                                 <title>Enabling and Disabling Languages</title>\r
8                                 <para>Evergreen 1.6 is bundled with support for a number of languages beyond American English (<emphasis role="bold">en-US</emphasis>). The translated interfaces are \r
9                                 split between static files that are automatically installed with Evergreen, and dynamic labels that can be stored in the Evergreen database. Evergreen is \r
10                                 installed with additional SQL files that contain translated dynamic labels for a number of languages, and to make the set of translated labels available in \r
11                                 all interfaces. Only a few steps are required to enable or disable one or more languages.</para>\r
12                                 <section>\r
13                                         <title>Enabling a Localization</title>\r
14                                         <para>To enable the translated labels for a given language to display in Evergreen, just populate the database with the translated labels and enable the localization. The following example illustrates how to enable Canadian French (<emphasis role="bold">fr-CA</emphasis>) support in the database. These same steps can be used with any of the languages bundled with Evergreen, or you can create and add your own localization.</para>\r
15                                         <orderedlist>\r
16                                                 <listitem>\r
17                                                         <para>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 command <command>psql</command>, substituting your user, host and database connection information accordingly:</para>\r
18 <programlisting language="xml"><![CDATA[\r
19 $ psql -U <username> -h <hostname> -d <database> -f /path/to/Evergreen-source/Open-ILS/src/sql/Pg/950.data.seed-values-fr-CA.sql\r
20 ]]></programlisting>\r
21                                                 </listitem>\r
22                                                 <listitem>\r
23                                                         <para>Ensure the locale is enabled in the Evergreen database by using the utility <command>psql</command> to check for the existence of the locale in the table <literal>config.i18n_locale</literal>:</para>\r
24                                                         <figure>\r
25                                                                 <title>Commands to check for localization</title>\r
26                                                                 <screen>\r
27                                                                 SELECT code, marc_code, name, description\r
28                                                                 FROM config.i18n_locale\r
29                                                                 WHERE code = 'fr-CA';\r
30                                                                 </screen>\r
31                                                         </figure>\r
32                                                         <para>As shown in the following example, if one row of output is returned, then the locale is already enabled:</para>\r
33                                                         <figure>\r
34                                                                 <title>Results of an installed localization</title>\r
35                                                                 <screen>\r
36                                                                 code  | marc_code |      name       |   description   \r
37                                                                 ------+-----------+-----------------+-----------------\r
38                                                                 fr-CA | fre       | French (Canada) | Canadian French\r
39                                                                 (1 row)\r
40                                                                 </screen>\r
41                                                         </figure>\r
42                                                         <para>If zero rows of output are returned, then the locale is not enabled:</para>\r
43                                                         <figure>\r
44                                                                 <title>Results of no installed localizations</title>\r
45                                                                 <screen>\r
46                                                                 code | marc_code | name | description \r
47                                                                 ------+-----------+------+-------------\r
48                                                                 (0 rows)\r
49                                                                 </screen>\r
50                                                         </figure>\r
51                                                         <para>To enable a locale, use <command>psql</command> to insert a row into the table <literal>config.i18n_locale</literal> as follows:</para>\r
52                                                         <figure>\r
53                                                                 <title>Commands to enable a locale in the database</title>\r
54                                                                 <screen>\r
55                                                                 INSERT INTO config.i18n_locale (code, marc_code, name, description)\r
56                                                                 VALUES ('fr-CA', 'fre', 'French (Canada)', 'Canadian French');\r
57                                                                 </screen>\r
58                                                         </figure>\r
59                                                 </listitem>\r
60                                         </orderedlist>\r
61                                 </section>\r
62                                 <section>\r
63                                         <title>Disabling a Localization</title>\r
64                                         <para>You might not want to offer all of the localizations that are preconfigured in Evergreen. If you choose to disable the dynamic labels for a locale, just delete those entries from the table <literal>config.i18n_locale</literal> using the <command>psql</command> utility:</para>\r
65                                         <figure>\r
66                                                 <title>Commands to delete localization from table</title>\r
67                                                 <screen>\r
68                                                 DELETE FROM config.i18n_locale\r
69                                                 WHERE code = 'fr-CA';\r
70                                                 </screen>\r
71                                         </figure>\r
72                                 </section>\r
73                         </section>\r
74 </chapter>\r