In .net, changed bold, italic, underline, and wrap to TriState. Also in .net, Excel...
[infodrom/rico3] / documentation / translations.html
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
2 <html>
3 <head>
4 <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
5 <title>Rico Translation</title>
6 <link href="ricoDocs.css" rel="Stylesheet" type="text/css">
7 </head>
8
9 <body>
10 <h1>Rico Translation</h1>
11
12 <p>The Rico library contains a translation object (RicoTranslate) so that
13 applications can be written using Rico that support multiple languages.
14 The translation object also stores the default date and number
15 formats, so that different defaults can be specified for each language.
16 The Rico distribution includes language files that load the translation object
17 with the phrases necessary to display the default grid menus and the Rico calendar.
18
19 <h2>Translation Status</h2>
20
21 <p>Language files are stored in
22 "src/translations/ricoLocale_xx.js" where xx is the 2-character language code. 
23 Rico is currently distributed with the following translations:
24
25 <p><table border='1' cellspacing='0' cellpadding='3'>
26 <thead>
27 <tr><th>Language</th><th>Code</th><th>Status</th></tr>
28 </thead>
29 <tbody>
30
31 <tr>
32 <td>English</td>
33 <td>en</td>
34 <td>Baseline</td>
35 </tr>
36
37 <tr>
38 <td>French</td>
39 <td>fr</td>
40 <td>Complete and reviewed</td>
41 </tr>
42
43 <tr>
44 <td>Spanish</td>
45 <td>es</td>
46 <td>Complete and reviewed</td>
47 </tr>
48
49 <tr>
50 <td>Japanese</td>
51 <td>ja</td>
52 <td>Complete and reviewed</td>
53 </tr>
54
55 <tr>
56 <td>Chinese (simplified)</td>
57 <td>zh</td>
58 <td>Complete and reviewed</td>
59 </tr>
60
61 <tr>
62 <td>Korean</td>
63 <td>ko</td>
64 <td>Complete and reviewed</td>
65 </tr>
66
67 <tr>
68 <td>German</td>
69 <td>de</td>
70 <td>Complete and reviewed</td>
71 </tr>
72
73 <tr>
74 <td>Portugese</td>
75 <td>pt</td>
76 <td>Complete, needs review</td>
77 </tr>
78
79 <tr>
80 <td>Italian</td>
81 <td>it</td>
82 <td>Complete, needs review</td>
83 </tr>
84
85 <tr>
86 <td>Russian</td>
87 <td>ru</td>
88 <td>Complete and reviewed</td>
89 </tr>
90
91 <tr>
92 <td>Ukranian</td>
93 <td>ua</td>
94 <td>Complete and reviewed</td>
95 </tr>
96
97 </tbody>
98 </table>
99
100 <h2>Supporting Multiple Languages</h2>
101
102 <p>As Rico evolves, additional phrases are required in the translation files.
103 English phrases are added first, then members of the Rico community
104 add the new phrases to the other translation files.
105 We try to keep all of the translations synchonized, 
106 but this is not always possible.
107 Therefore, when rico.js is loaded, it in turn loads the language file 
108 for English first. 
109 Then it looks for a Rico translation matching the user's OS or browser language.
110 If one is found, it is loaded next.
111 This ensures that, if a phrase is missing from a translation file or a translation
112 for their language is not available, the user at least
113 sees the phrase in English (instead of a blank message).
114
115 <p>So with no additional coding, Rico should, in most cases, 
116 present localized menus and calendars that are appropriate to the user.
117 However, all modern browsers give the user a way to override the OS language.
118 For example, in Firefox you go to Tools menu > Options > Advanced > General Tab > Languages button.
119 In Internet Explorer you go to Tools menu > Internet Options > General Tab > Languages button.
120 This setting is called the 
121 <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.4">accept language</a> 
122 and is not directly accessible via javascript.
123 However, Rico does provide a way to load a translation file based on the accept language.
124 For users who have configured this setting, the language resolved using this approach
125 may be closer to their true preference.
126 The accept language is resolved in Rico by having the server-side script return the
127 accept language header back to the javascript method "Rico.acceptLanguage()".
128 This happens automatically when using the LiveGrid Forms plug-ins for ASP and PHP,
129 and in the LiveGrid plug-in for .net.
130 For other situations, server-side include files are provided in the Rico distribution.
131
132 <p>In PHP:
133 <pre>
134 &lt;? 
135 // Not required when using ricoLiveGridForms.php
136 // Must be placed after the line to include rico.js
137
138 require "chklang2.php";
139 ?&gt;
140 </pre>
141
142 <p>In ASP:
143 <pre>
144 ' Not required when using ricoLiveGridForms.asp
145 ' Must be placed after the line to include rico.js
146
147 &lt;!-- #INCLUDE FILE = "chklang2.vbs" --&gt;
148 </pre>
149
150 <p>In .net:
151 <pre>
152 ' Not required when using ricoLiveGrid.ascx
153 ' Must be placed after the line to include rico.js
154
155 &lt;%@ Register TagPrefix="Rico" TagName="ChkLang" Src="chklang.ascx" %&gt;
156 &lt;Rico:ChkLang runat='server' id='translation' /&gt;
157 </pre>
158
159 <h2>RicoTranslate Object Reference</h2>
160
161 <p>The RicoTranslate object contains the following properties and methods:
162 <dl>
163 <dt>monthNames[]
164 <dd>A 12 item array containing the translated names of each month (January is item 0)
165 <dt>dayNames[]
166 <dd>A 7 item array containing the translated names of each day of the week (Sunday is item 0)
167 <dt>monthAbbr()
168 <dd>A function that takes a month number (0-11) and returns the abbreviated month name (defaults to the first 3 characters of monthNames[], but is overridden by some translations)
169 <dt>dayAbbr()
170 <dd>A function that takes a day of week number (0-6) and returns the abbreviated day name (defaults to the first 3 characters of dayNames[], but is overridden by some translations)
171 <dt>langCode
172 <dd>Contains the 2-character language code that is currently loaded (default is "en")
173 <dt>thouSep
174 <dd>Contains the character to use as the thousands separator when formatting numbers (default is ",")
175 <dt>decPoint
176 <dd>Contains the character to use as the decimal point when formatting numbers (default is ".")
177 <dt>dateFmt
178 <dd>Contains the default date format (default is "mm/dd/yyyy")
179 <dt>timeFmt
180 <dd>Contains the default time format (default is "hh:nn:ss a/pm")
181 <dt>addPhraseId (phraseId, phrase)
182 <dd>Adds the specified phrase and assigns it to phraseId. The phrase string may contain references to optional substitution parameters, which are specified using $1, $2, etc.
183 <dt>getPhraseById (phraseId)
184 <dd>Returns the phrase specified by phraseId. Optional substitution parameters may follow phraseId.
185 </dl>
186
187 <h2>Submitting Updates</h2>
188
189 <p>Questions and corrections may be posted to the 
190 <a href='http://sourceforge.net/forum/forum.php?forum_id=470997'>Open Discussion forum on SourceForge</a>.
191 Alternatively, you can send them directly to: dowdybrown at yahoo dot com.
192
193 </body>
194 </html>