Add file for 1.6 branch.
[Evergreen-DocBook.git] / admin / localization.xml
diff --git a/admin/localization.xml b/admin/localization.xml
new file mode 100644 (file)
index 0000000..a237e3c
--- /dev/null
@@ -0,0 +1,70 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<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
+<info>\r
+<title>Languages and Localization</title>\r
+</info>\r
+       <section xml:id="enabling_and_disabling_localization">                  \r
+               <title>Enabling and Disabling Languages</title>\r
+               <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
+               split between static files that are automatically installed with Evergreen, and dynamic labels that can be stored in the Evergreen database. Evergreen is \r
+               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
+               all interfaces. Only a few steps are required to enable or disable one or more languages.</para>\r
+               <simplesect>\r
+                       <title>Enabling a Localization</title>\r
+                       <indexterm><primary>languages</primary><secondary>enabling a localization</secondary></indexterm>\r
+                       <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 \r
+                       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 \r
+                       languages bundled with Evergreen, or you can create and add your own localization.</para>\r
+                       <orderedlist>\r
+                               <listitem>\r
+                                       <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 \r
+                                       the translation. Load the translated labels into the Evergreen database using the command <command>psql</command>, substituting your user, host and \r
+                                       database connection information accordingly:</para>\r
+<programlisting language="xml"><![CDATA[\r
+$ psql -U <username> -h <hostname> -d <database> \ \r
+-f /path/to/Evergreen-source/Open-ILS/src/sql/Pg/950.data.seed-values-fr-CA.sql\r
+]]></programlisting>\r
+                               </listitem>\r
+                               <listitem>\r
+                                       <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 \r
+                                       table <literal>config.i18n_locale</literal>:</para>\r
+                                       \r
+<screen>\r
+<userinput>SELECT code, marc_code, name, description\r
+FROM config.i18n_locale\r
+WHERE code = 'fr-CA';</userinput>\r
+</screen>\r
+                               \r
+                                       <para>As shown in the following example, if one row of output is returned, then the locale is already enabled:</para>\r
+<screen>\r
+code  | marc_code |      name       |   description   \r
+------+-----------+-----------------+-----------------\r
+fr-CA | fre       | French (Canada) | Canadian French\r
+(1 row)\r
+</screen>\r
+                                       <para>If zero rows of output are returned, then the locale is not enabled:</para>\r
+<screen>\r
+code | marc_code | name | description \r
+------+-----------+------+-------------\r
+(0 rows)\r
+</screen>\r
+                                       <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
+<screen>\r
+INSERT INTO config.i18n_locale (code, marc_code, name, description)\r
+VALUES ('fr-CA', 'fre', 'French (Canada)', 'Canadian French');\r
+</screen>\r
+                               </listitem>\r
+                       </orderedlist>\r
+               </simplesect>\r
+               <simplesect>\r
+                       <title>Disabling a Localization</title>\r
+                       <indexterm><primary>languages</primary><secondary>disabling a localization</secondary></indexterm>\r
+                       <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 \r
+                       entries from the table <literal>config.i18n_locale</literal> using the <command>psql</command> utility:</para>\r
+<screen>\r
+<userinput>DELETE FROM config.i18n_locale\r
+WHERE code = 'fr-CA';</userinput>\r
+</screen>\r
+               </simplesect>\r
+       </section>\r
+</chapter>\r