1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
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">
10 <h1>Rico Translation</h1>
12 <p><a href='translations_ja.html'><img src='images/japanese.gif' alt='View this page in Japanese'></a>
13 <a href='translations_ja.html'>View this page in Japanese</a></p>
15 <p>The Rico library contains a translation object (RicoTranslate) so that
16 applications can be written using Rico that support multiple languages.
17 The translation object also stores the default date and number
18 formats, so that different defaults can be specified for each language.
19 The Rico distribution includes language files that load the translation object
20 with the phrases necessary to display the default grid menus and the Rico calendar.
22 <h2>Translation Status</h2>
24 <p>Language files are stored in
25 "src/translations/ricoLocale_xx.js" where xx is the 2-character language code.
26 Rico is currently distributed with the following translations:
28 <p><table border='1' cellspacing='0' cellpadding='3'>
30 <tr><th>Language</th><th>Code</th><th>Status</th></tr>
43 <td>Complete and reviewed</td>
49 <td>Complete and reviewed</td>
55 <td>Complete and reviewed</td>
59 <td>Chinese (simplified)</td>
61 <td>Complete and reviewed</td>
67 <td>Complete and reviewed</td>
73 <td>Complete and reviewed</td>
79 <td>Complete, needs review</td>
85 <td>Complete, needs review</td>
91 <td>Complete and reviewed</td>
97 <td>Complete and reviewed</td>
103 <h2>Supporting Multiple Languages</h2>
105 <p>As Rico evolves, additional phrases are required in the translation files.
106 English phrases are added first, then members of the Rico community
107 add the new phrases to the other translation files.
108 We try to keep all of the translations synchonized,
109 but this is not always possible.
110 Therefore, when rico.js is loaded, it in turn loads the language file
112 Then it looks for a Rico translation matching the user's OS or browser language.
113 If one is found, it is loaded next.
114 This ensures that, if a phrase is missing from a translation file or a translation
115 for their language is not available, the user at least
116 sees the phrase in English (instead of a blank message).
118 <p>So with no additional coding, Rico should, in most cases,
119 present localized menus and calendars that are appropriate to the user.
120 However, all modern browsers give the user a way to override the OS language.
121 For example, in Firefox you go to Tools menu > Options > Advanced > General Tab > Languages button.
122 In Internet Explorer you go to Tools menu > Internet Options > General Tab > Languages button.
123 This setting is called the
124 <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.4">accept language</a>
125 and is not directly accessible via javascript.
126 However, Rico does provide a way to load a translation file based on the accept language.
127 For users who have configured this setting, the language resolved using this approach
128 may be closer to their true preference.
129 The accept language is resolved in Rico by having the server-side script return the
130 accept language header back to the javascript method "Rico.acceptLanguage()".
131 This happens automatically when using the LiveGrid Forms plug-ins for ASP and PHP,
132 and in the LiveGrid plug-in for .net.
133 For other situations, server-side include files are provided in the Rico distribution.
138 // Not required when using ricoLiveGridForms.php
139 // Must be placed after the line to include rico.js
141 require "chklang2.php";
147 ' Not required when using ricoLiveGridForms.asp
148 ' Must be placed after the line to include rico.js
150 <!-- #INCLUDE FILE = "chklang2.vbs" -->
155 ' Not required when using ricoLiveGrid.ascx
156 ' Must be placed after the line to include rico.js
158 <%@ Register TagPrefix="Rico" TagName="ChkLang" Src="chklang.ascx" %>
159 <Rico:ChkLang runat='server' id='translation' />
162 <h2>RicoTranslate Object Reference</h2>
164 <p>The RicoTranslate object contains the following properties and methods:
167 <dd>A 12 item array containing the translated names of each month (January is item 0)
169 <dd>A 7 item array containing the translated names of each day of the week (Sunday is item 0)
171 <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)
173 <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)
175 <dd>Contains the 2-character language code that is currently loaded (default is "en")
177 <dd>Contains the character to use as the thousands separator when formatting numbers (default is ",")
179 <dd>Contains the character to use as the decimal point when formatting numbers (default is ".")
181 <dd>Contains the default date format (default is "mm/dd/yyyy")
183 <dd>Contains the default time format (default is "hh:nn:ss a/pm")
184 <dt>addPhraseId (phraseId, phrase)
185 <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.
186 <dt>getPhraseById (phraseId)
187 <dd>Returns the phrase specified by phraseId. Optional substitution parameters may follow phraseId.
190 <h2>Submitting Updates</h2>
192 <p>Questions and corrections may be posted to the
193 <a href='http://sourceforge.net/forum/forum.php?forum_id=470997'>Open Discussion forum on SourceForge</a>.
194 Alternatively, you can send them directly to: dowdybrown at yahoo dot com.