[doc] misc. fix & improvements
[scilab.git] / scilab / modules / localization / help / en_US / setlanguage.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!--
3  * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
4  * Copyright (C) 2007 - INRIA - Allan CORNET
5  * Copyright (C) 2007 - INRIA - Sylvestre LEDRU
6  * Copyright (C) 2016 - Samuel GOUGEON
7  *
8  * Copyright (C) 2012 - 2016 - Scilab Enterprises
9  *
10  * This file is hereby licensed under the terms of the GNU GPL v2.0,
11  * pursuant to article 5.3.4 of the CeCILL v.2.1.
12  * This file was originally licensed under the terms of the CeCILL v2.1,
13  * and continues to be available under such terms.
14  * For more information, see the COPYING file which you should have received
15  * along with this program.
16  *
17  -->
18 <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:lang="en" xml:id="setlanguage">
19     <refnamediv>
20         <refname>setlanguage</refname>
21         <refpurpose>chooses the language used for standard messages and help pages for the current session</refpurpose>
22     </refnamediv>
23     <refsynopsisdiv>
24         <title>Syntax</title>
25         <synopsis>TF = setlanguage(language)</synopsis>
26     </refsynopsisdiv>
27     <refsection role="parameters">
28         <title>Arguments</title>
29         <variablelist>
30             <varlistentry>
31                 <term>language</term>
32                 <listitem>
33                     <para>single string among 'en', 'fr', 'ja', 'pt', 'ru', 'de', en_US', 'fr_FR',
34                         'ja_JP', 'pt_BR', 'ru_RU', 'de_DE', 'zh_TW'...
35                     </para>
36                 </listitem>
37             </varlistentry>
38             <varlistentry>
39                 <term>TF</term>
40                 <listitem>
41                     <para>
42                         single boolean: <literal>%T</literal> if the setting has been actually
43                         performed, <literal>%F</literal> otherwise.
44                     </para>
45                 </listitem>
46             </varlistentry>
47         </variablelist>
48     </refsection>
49     <refsection role="description">
50         <title>Description</title>
51         <para>
52             <literal>setlanguage(language)</literal> changes the language used for error or warning
53             messages or other standard words and texts such as the name of days and months, etc.
54             If their translation is available, help pages are also displayed in the chosen language,
55             after restarting the help browser.
56         </para>
57         <para>
58             The chosen language applies only to the current Scilab session.
59         </para>
60         <para>
61             <literal>setlanguage('')</literal> resets the language to the system value
62             <literal>"en_US"</literal> and returns <literal>%F</literal>.
63         </para>
64         <para>
65             <literal>setlanguage</literal> works on all supported operating systems.
66         </para>
67         <warning>The new language is not taken into account in the menus of interfaces (help browser,
68             variables browser, code editor, etc). No menus translation is done neither "on-the-flight"
69             nor after reopening the interfaces. To set the language used in the menus, please use
70             <literal>setdefaultlanguage(..)</literal> instead.
71         </warning>
72     </refsection>
73     <refsection role="examples">
74         <title>Examples</title>
75         <programlisting role="example"><![CDATA[
76 L = getlanguage();
77
78 // Translated strings
79 setlanguage ja;
80 _ Monday
81 setlanguage pt_BR;
82 _ Monday
83 setlanguage ru;
84 _ July
85
86 // Error messages:
87 setlanguage en;
88 linspace("") // to yield and display an error message
89 setlanguage ja;
90 linspace("")
91 setlanguage ru;
92 linspace("")
93
94 help linspace // the page should appear in Russian (if the help browser was closed)
95
96 // Restoring the initial language
97 setlanguage(L)
98  ]]></programlisting>
99     </refsection>
100     <refsection role="see also">
101         <title>See also</title>
102         <simplelist type="inline">
103             <member>
104                 <link linkend="setdefaultlanguage">setdefaultlanguage</link>
105             </member>
106             <member>
107                 <link linkend="getlanguage">getlanguage</link>
108             </member>
109             <member>
110                 <link linkend="gettext">gettext</link>
111             </member>
112         </simplelist>
113     </refsection>
114 </refentry>