locale 2.0.2 → 2.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/ChangeLog +3 -0
- data/benchmark/benchmark.rb +34 -0
- data/benchmark/benchmark_2.0.1.txt +7 -0
- data/doc/classes/Locale.html +1244 -0
- data/doc/classes/Locale/Driver.html +374 -0
- data/doc/classes/Locale/Driver/CGI.html +536 -0
- data/doc/classes/Locale/Driver/Env.html +439 -0
- data/doc/classes/Locale/Driver/JRuby.html +389 -0
- data/doc/classes/Locale/Driver/Posix.html +430 -0
- data/doc/classes/Locale/Driver/Win32.html +398 -0
- data/doc/classes/Locale/Driver/Win32Table.html +355 -0
- data/doc/classes/Locale/Info.html +585 -0
- data/doc/classes/Locale/Info/Language.html +763 -0
- data/doc/classes/Locale/Info/Region.html +470 -0
- data/doc/classes/Locale/Tag.html +433 -0
- data/doc/classes/Locale/Tag/Cldr.html +523 -0
- data/doc/classes/Locale/Tag/Common.html +624 -0
- data/doc/classes/Locale/Tag/Irregular.html +423 -0
- data/doc/classes/Locale/Tag/Posix.html +612 -0
- data/doc/classes/Locale/Tag/Rfc.html +581 -0
- data/doc/classes/Locale/Tag/Simple.html +721 -0
- data/doc/classes/Locale/TagList.html +826 -0
- data/doc/classes/Locale/Util.html +506 -0
- data/doc/classes/Locale/Util/Memoizable.html +355 -0
- data/doc/created.rid +1 -0
- data/doc/files/ChangeLog.html +537 -0
- data/doc/files/README_rdoc.html +565 -0
- data/doc/files/lib/locale/driver/cgi_rb.html +341 -0
- data/doc/files/lib/locale/driver/env_rb.html +353 -0
- data/doc/files/lib/locale/driver/jruby_rb.html +353 -0
- data/doc/files/lib/locale/driver/posix_rb.html +341 -0
- data/doc/files/lib/locale/driver/win32_rb.html +348 -0
- data/doc/files/lib/locale/driver/win32_table_rb.html +341 -0
- data/doc/files/lib/locale/info/language_rb.html +352 -0
- data/doc/files/lib/locale/info/region_rb.html +352 -0
- data/doc/files/lib/locale/info_rb.html +353 -0
- data/doc/files/lib/locale/tag/cldr_rb.html +348 -0
- data/doc/files/lib/locale/tag/common_rb.html +348 -0
- data/doc/files/lib/locale/tag/irregular_rb.html +348 -0
- data/doc/files/lib/locale/tag/posix_rb.html +341 -0
- data/doc/files/lib/locale/tag/rfc_rb.html +348 -0
- data/doc/files/lib/locale/tag/simple_rb.html +348 -0
- data/doc/files/lib/locale/tag_rb.html +378 -0
- data/doc/files/lib/locale/taglist_rb.html +348 -0
- data/doc/files/lib/locale/util/memoizable_rb.html +359 -0
- data/doc/files/lib/locale/version_rb.html +341 -0
- data/doc/files/lib/locale_rb.html +363 -0
- data/doc/fr_class_index.html +22 -0
- data/doc/fr_file_index.html +23 -0
- data/doc/fr_method_index.html +99 -0
- data/doc/index.html +1 -0
- data/doc/rdoc-style.css +320 -0
- data/lib/locale/util/memoizable.rb.20090328 +96 -0
- data/lib/locale/util/memoizable.rb.old +91 -0
- data/lib/locale/version.rb +1 -1
- data/replace.rb +21 -0
- data/test.rb +28 -0
- data/test/test.rb +7 -0
- data/test/tmp.txt +20 -0
- data/test2.rb +14 -0
- data/test3.rb +12 -0
- metadata +75 -1
@@ -0,0 +1,565 @@
|
|
1
|
+
<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" lang="en"><head><meta content="text/html; charset=utf-8" http-equiv="Content-Type"/><title>File: README.rdoc</title><link type="text/css" href=".././rdoc-style.css" media="screen" rel="stylesheet"/><script type="text/javascript">
|
2
|
+
// Allison template
|
3
|
+
// Copyright 2007, 2008 Cloudburst, LLC. Licensed under the AFL 3. See the included LICENSE file.
|
4
|
+
|
5
|
+
var href_base = '.././rdoc-style.css'.replace(/(.*\/).*/, '$1'); // inline js is good for something
|
6
|
+
|
7
|
+
function $(id) {
|
8
|
+
if (document.getElementById)
|
9
|
+
elem = document.getElementById(id);
|
10
|
+
else if ( document.all )
|
11
|
+
elem = eval("document.all." + id);
|
12
|
+
else
|
13
|
+
return false;
|
14
|
+
return elem;
|
15
|
+
}
|
16
|
+
|
17
|
+
function toggle(id) {
|
18
|
+
elem = $(id);
|
19
|
+
elemStyle = elem.style;
|
20
|
+
if (elemStyle.display == "block") {
|
21
|
+
elemStyle.display = "none"
|
22
|
+
} else {
|
23
|
+
elemStyle.display = "block"
|
24
|
+
}
|
25
|
+
return true;
|
26
|
+
}
|
27
|
+
|
28
|
+
function toggleText(id) {
|
29
|
+
elem = $(id)
|
30
|
+
if (m = elem.innerHTML.match(/(Hide)(.*)/)) {
|
31
|
+
elem.innerHTML = "Show" + m[2];
|
32
|
+
} else if (m = elem.innerHTML.match(/(Show)(.*)/)) {
|
33
|
+
elem.innerHTML = "Hide" + m[2];
|
34
|
+
}
|
35
|
+
return true;
|
36
|
+
}
|
37
|
+
|
38
|
+
function span(s, klass) {
|
39
|
+
return '<span class="' + klass + '">' + s + '</span>';
|
40
|
+
}
|
41
|
+
|
42
|
+
function highlightSymbols() {
|
43
|
+
pres = document.getElementsByTagName('pre');
|
44
|
+
for(var i = 0; i < pres.length; i++) {
|
45
|
+
pre = pres[i];
|
46
|
+
spans = pre.getElementsByTagName('span');
|
47
|
+
for(var k = 0; k < spans.length; k++) {
|
48
|
+
span = spans[k];
|
49
|
+
if (span.className.match(/ruby-identifier/)) {
|
50
|
+
if (span.innerHTML.match(/^:/)) {
|
51
|
+
span.className += " ruby-symbol";
|
52
|
+
}
|
53
|
+
}
|
54
|
+
}
|
55
|
+
}
|
56
|
+
}
|
57
|
+
|
58
|
+
function hasClass(obj) {
|
59
|
+
var result = false;
|
60
|
+
if (obj.getAttributeNode("class") != null) {
|
61
|
+
result = obj.getAttributeNode("class").value;
|
62
|
+
}
|
63
|
+
return result;
|
64
|
+
}
|
65
|
+
|
66
|
+
function stripe() {
|
67
|
+
var even = true;
|
68
|
+
var color = "#e4ebed";
|
69
|
+
var tables = document.getElementsByTagName('table');
|
70
|
+
if (tables.length == 0) { return; }
|
71
|
+
for (var h = 0; h < tables.length; h++) {
|
72
|
+
var trs = tables[h].getElementsByTagName("tr");
|
73
|
+
for (var i = 0; i < trs.length; i++) {
|
74
|
+
var tds = trs[i].getElementsByTagName("td");
|
75
|
+
for (var j = 0; j < tds.length; j++) {
|
76
|
+
if (hasClass(tds[j]) != "first") {
|
77
|
+
var mytd = tds[j];
|
78
|
+
if (even) {
|
79
|
+
mytd.style.backgroundColor = color;
|
80
|
+
}
|
81
|
+
}
|
82
|
+
}
|
83
|
+
even = ! even;
|
84
|
+
}
|
85
|
+
}
|
86
|
+
}
|
87
|
+
|
88
|
+
function ajaxGet(url) {
|
89
|
+
url = (href_base + url).replace('/./', '/')
|
90
|
+
var req = false;
|
91
|
+
|
92
|
+
if (window.ActiveXObject) {
|
93
|
+
try {
|
94
|
+
// stupid hack because IE7 disables local Ajax with the native xmlhttprequest object
|
95
|
+
// for security purposes. Yet ActiveX still works. Thanks, Microsoft. I hate you. Die.
|
96
|
+
req = new ActiveXObject("MSXML2.XMLHTTP.3.0");
|
97
|
+
} catch (e) {
|
98
|
+
try {
|
99
|
+
/* IE 6 and maybe 5, don't know, don't care */
|
100
|
+
req = new ActiveXObject("Msxml2.XMLHTTP");
|
101
|
+
} catch (e) {
|
102
|
+
try {
|
103
|
+
req = new ActiveXObject("Microsoft.XMLHTTP");
|
104
|
+
} catch (e) {
|
105
|
+
req = false;
|
106
|
+
}
|
107
|
+
}
|
108
|
+
}
|
109
|
+
}
|
110
|
+
|
111
|
+
/* real browsers */
|
112
|
+
if (!req && window.XMLHttpRequest) {
|
113
|
+
try {
|
114
|
+
req = new XMLHttpRequest();
|
115
|
+
} catch (e) {
|
116
|
+
req = false;
|
117
|
+
}
|
118
|
+
}
|
119
|
+
|
120
|
+
if (req) {
|
121
|
+
req.open('GET', url, false);
|
122
|
+
req.send(null);
|
123
|
+
return req.responseText;
|
124
|
+
} else {
|
125
|
+
return "Ajax error";
|
126
|
+
}
|
127
|
+
}
|
128
|
+
|
129
|
+
|
130
|
+
function addEvent(elm, evType, fn, useCapture) {
|
131
|
+
if (elm.addEventListener) {
|
132
|
+
elm.addEventListener(evType, fn, useCapture);
|
133
|
+
return true;
|
134
|
+
} else if (elm.attachEvent) {
|
135
|
+
var r = elm.attachEvent('on' + evType, fn);
|
136
|
+
return r;
|
137
|
+
} else {
|
138
|
+
elm['on' + evType] = fn;
|
139
|
+
}
|
140
|
+
}
|
141
|
+
|
142
|
+
function insertIndices() {
|
143
|
+
pages = ["class", "file", "method"]
|
144
|
+
for (x in pages) {
|
145
|
+
$(pages[x]).innerHTML += ajaxGet('fr_' + pages[x] + '_index.html').replace(/(href=")/g, '$1' + href_base);
|
146
|
+
}
|
147
|
+
/* mouseoverify method links */
|
148
|
+
links = $('method').getElementsByTagName('a');
|
149
|
+
for (var x = 0; x < links.length; x++) {
|
150
|
+
if (m = links[x].innerHTML.match(/(.*)\s\((.*)\)/)) {
|
151
|
+
links[x].innerHTML = m[1] + '<br>';
|
152
|
+
links[x].title = m[2];
|
153
|
+
}
|
154
|
+
}
|
155
|
+
/* this is stupid */
|
156
|
+
$('class').style.display = "block";
|
157
|
+
$('file').style.display = "block";
|
158
|
+
|
159
|
+
/* has to be here because IE7 does not guarantee the onLoad callback order */
|
160
|
+
abbreviateIndicesInner(["class", "file"], 25, "a");
|
161
|
+
/* same, linkTitle() depends on the class link list */
|
162
|
+
linkTitle();
|
163
|
+
}
|
164
|
+
|
165
|
+
function abbreviateIndices() {
|
166
|
+
var ids = ["defined_in", "child_of", "includes", "requires", "method", "methods"];
|
167
|
+
abbreviateIndicesInner(ids, 25, 'a');
|
168
|
+
abbreviateIndicesInner(ids, 25, 'span');
|
169
|
+
}
|
170
|
+
|
171
|
+
function abbreviateIndicesInner(indices, amount, tag) {
|
172
|
+
for (var x = 0; x < indices.length; x++) {
|
173
|
+
var the_index = $(indices[x]);
|
174
|
+
if (the_index) {
|
175
|
+
links = the_index.getElementsByTagName(tag);
|
176
|
+
for (var y = 0; y < links.length; y++) {
|
177
|
+
var link = links[y];
|
178
|
+
if (link.getElementsByTagName('span').length == 0 && link.getElementsByTagName('a').length == 0) {
|
179
|
+
// avoid nesting
|
180
|
+
link.innerHTML = link.innerHTML.replace(/<br>|\n/gi, '');
|
181
|
+
link.title = link.innerHTML;
|
182
|
+
link.innerHTML = abbreviate(link.innerHTML, amount) + '<br>';
|
183
|
+
}
|
184
|
+
}
|
185
|
+
}
|
186
|
+
}
|
187
|
+
}
|
188
|
+
|
189
|
+
function linkTitle() {
|
190
|
+
|
191
|
+
/* grab the correct title element from the index */
|
192
|
+
var index_page = ajaxGet('index.html');
|
193
|
+
title_text = index_page.match(/<title>(.*)<\/title>/m)[1];
|
194
|
+
document.title = title_text + " - " + document.title;
|
195
|
+
var p = $('header').getElementsByTagName('p')[0]
|
196
|
+
if (p.innerHTML.match(/^\s*$/)) {
|
197
|
+
p.innerHTML = title_text;
|
198
|
+
} else {
|
199
|
+
p.innerHTML = title_text + ": " + p.innerHTML;
|
200
|
+
}
|
201
|
+
|
202
|
+
/* set the link properly */
|
203
|
+
title_link = index_page.match(/<a\s+href="(.*?)"/)[1];
|
204
|
+
var element = $('title');
|
205
|
+
var item_type = "";
|
206
|
+
var item_name = "";
|
207
|
+
if (m = element.innerHTML.match(/(Class:|Module:|File:)\s*(.*)/)) {
|
208
|
+
item_type = m[1];
|
209
|
+
item_name = m[2];
|
210
|
+
} else {
|
211
|
+
item_name = element.innerHTML;
|
212
|
+
}
|
213
|
+
element.innerHTML = '<a href="' + href_base + title_link + '">' + item_type + " " + abbreviate(item_name, 45) + '</a>';
|
214
|
+
element.getElementsByTagName('a')[0].title = item_name
|
215
|
+
|
216
|
+
/* breadcrumb navigation */
|
217
|
+
items = item_name.split("::");
|
218
|
+
items_new = item_name.split("::");
|
219
|
+
file_links = $('class').getElementsByTagName('a');
|
220
|
+
for (var x = 0; x < items.length - 1; x++ ){
|
221
|
+
var item = items[x];
|
222
|
+
link = ("/classes/" + items.slice(0,x).join("/") + "/" + item + ".html").replace('//', '/');
|
223
|
+
regex = new RegExp(RegExp.escape(link) + '$');
|
224
|
+
for (var y = 0; y < file_links.length; y++) {
|
225
|
+
if (file_links[y].href.match(regex)) {
|
226
|
+
items_new[x] = '<a href="' + href_base + link + '">' + item + '</a>';
|
227
|
+
break;
|
228
|
+
}
|
229
|
+
}
|
230
|
+
}
|
231
|
+
$('item_name').innerHTML = item_type + ' ' + items_new.join(" :: ");
|
232
|
+
}
|
233
|
+
|
234
|
+
function abbreviate(s, size) {
|
235
|
+
while (s.length > size) {
|
236
|
+
var old_s = s;
|
237
|
+
s = s.replace(/\s|\n/mg, '');
|
238
|
+
s = s.replace(/([A-Z])[a-z]+/m, '$1');
|
239
|
+
if (!s || old_s == s) {
|
240
|
+
return "..." + s.substring(s.length - size, s.length);
|
241
|
+
}
|
242
|
+
}
|
243
|
+
return s;
|
244
|
+
}
|
245
|
+
|
246
|
+
function disableSubmit(event) {
|
247
|
+
var keyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode;
|
248
|
+
if (keyCode == 13) {
|
249
|
+
return false;
|
250
|
+
} else {
|
251
|
+
return true;
|
252
|
+
}
|
253
|
+
}
|
254
|
+
|
255
|
+
function filterList(id, s, event) {
|
256
|
+
|
257
|
+
/* some weak escaping */
|
258
|
+
s = s.replace(/[^\w\d\.\_\-\/\:\=\[\]\?\!]/g, '');
|
259
|
+
s = RegExp.escape(s);
|
260
|
+
|
261
|
+
var show_all = false;
|
262
|
+
if (s.match(/^\s*$/)) {
|
263
|
+
show_all = true;
|
264
|
+
}
|
265
|
+
|
266
|
+
links = $(id).getElementsByTagName('a')
|
267
|
+
regex = new RegExp(s, 'i');
|
268
|
+
|
269
|
+
for (var x = 0; x < links.length; x++) {
|
270
|
+
var link = links[x];
|
271
|
+
if (show_all) {
|
272
|
+
link.style.display = 'inline';
|
273
|
+
} else {
|
274
|
+
if (link.innerHTML.match(regex)) {
|
275
|
+
link.style.display = 'inline';
|
276
|
+
} else {
|
277
|
+
link.style.display = 'none';
|
278
|
+
}
|
279
|
+
}
|
280
|
+
}
|
281
|
+
return true;
|
282
|
+
}
|
283
|
+
|
284
|
+
RegExp.escape = function(text) {
|
285
|
+
if (!arguments.callee.sRE) {
|
286
|
+
var specials = ['/', '.', '*', '+', '?', '|', '(', ')', '[', ']', '{', '}', '\\'];
|
287
|
+
arguments.callee.sRE = new RegExp(
|
288
|
+
'(\\' + specials.join('|\\') + ')', 'g'
|
289
|
+
);
|
290
|
+
}
|
291
|
+
return text.replace(arguments.callee.sRE, '\\$1');
|
292
|
+
}
|
293
|
+
|
294
|
+
function hacks() {
|
295
|
+
// show the spacer if necessary,
|
296
|
+
divs = document.getElementsByTagName('div');
|
297
|
+
for(var x = 0; x < divs.length; x++) {
|
298
|
+
if (divs[x].className && divs[x].className.match(/top/)) {
|
299
|
+
document.getElementById('spacer').style.display = 'block';
|
300
|
+
}
|
301
|
+
}
|
302
|
+
// remove extra colons from tables
|
303
|
+
tds = document.getElementsByTagName('td');
|
304
|
+
for(var x = 0; x < tds.length; x++) {
|
305
|
+
str = tds[x].innerHTML
|
306
|
+
if (str.charAt(str.length - 1) == ":") {
|
307
|
+
tds[x].innerHTML = str.slice(0, str.length - 1)
|
308
|
+
}
|
309
|
+
}
|
310
|
+
}
|
311
|
+
|
312
|
+
addEvent(window, 'load', insertIndices, false);
|
313
|
+
addEvent(window, 'load', abbreviateIndices, false);
|
314
|
+
addEvent(window, 'load', stripe, false);
|
315
|
+
addEvent(window, 'load', highlightSymbols, false);
|
316
|
+
addEvent(window, 'load', hacks, false);
|
317
|
+
</script></head><body><div id="container"><div class="curve" id="preheader_curve_0"></div><div class="curve" id="preheader_curve_1"></div><div class="curve" id="preheader_curve_2"></div><div class="curve" id="preheader_curve_3"></div><div class="curve" id="preheader_curve_4"></div><div class="curve" id="preheader_curve_5"></div><div id="header"><p>
|
318
|
+
README.rdoc
|
319
|
+
</p><span><h1 id="title">
|
320
|
+
File: README.rdoc
|
321
|
+
</h1></span></div><div class="clear"></div><div id="left">
|
322
|
+
|
323
|
+
|
324
|
+
|
325
|
+
|
326
|
+
<div id="spacer"></div><div class="navigation darker index" id="class_wrapper"><div class="list_header"><h3>All classes</h3></div><div class="list_header_link"><a href="#" onclick="toggle('class'); toggleText('class_link'); return false;" id="class_link">Hide...</a></div><div class="clear"></div><div id="class"><form><label for="filter_class">Filter: </label><input type="text" onKeyUp="return filterList('class', this.value, event);" onKeyPress="return disableSubmit(event);" id="filter_class"></input></form></div></div><div class="navigation darker index" id="file_wrapper"><div class="list_header"><h3>All files</h3></div><div class="list_header_link"><a href="#" onclick="toggle('file'); toggleText('file_link'); return false;" id="file_link">Hide...</a></div><div class="clear"></div><div id="file"><form><label for="filter_file">Filter: </label><input type="text" onKeyUp="return filterList('file', this.value, event);" onKeyPress="return disableSubmit(event);" id="filter_file"></input></form></div></div><div class="navigation darker index" id="method_wrapper"><div class="list_header"><h3>All methods</h3></div><div class="list_header_link"><a href="#" onclick="toggle('method'); toggleText('method_link'); return false;" id="method_link">Show...</a></div><div class="clear"></div><div id="method"><form><label for="filter_method">Filter: </label><input type="text" onKeyUp="return filterList('method', this.value, event);" onKeyPress="return disableSubmit(event);" id="filter_method"></input></form></div></div></div><div id="content">
|
327
|
+
<h1 id="item_name">File: README.rdoc</h1>
|
328
|
+
|
329
|
+
<div id="description"><h1>Ruby-<a href="../classes/Locale.html">Locale</a></h1>
|
330
|
+
<p>
|
331
|
+
Ruby-<a href="../classes/Locale.html">Locale</a> is the pure ruby library
|
332
|
+
which provides basic and general purpose APIs for localization. It aims to
|
333
|
+
support all environments which ruby works and all kind of programs (GUI,
|
334
|
+
WWW, library, etc), and becomes the hub of other i18n/l10n libs/apps to
|
335
|
+
handle major locale ID standards.
|
336
|
+
</p>
|
337
|
+
<ul>
|
338
|
+
<li>Manage <a href="../classes/Locale.html">Locale</a> ID(Language Tag)
|
339
|
+
|
340
|
+
<ul>
|
341
|
+
<li>Each thread has a <a href="../classes/Locale.html">Locale</a> ID.
|
342
|
+
|
343
|
+
</li>
|
344
|
+
<li>POSIX, CLDR, IETF(RFC4646, 3066(BCP47)), Win32 and Java language tags and
|
345
|
+
convert the tag string to each other.
|
346
|
+
|
347
|
+
</li>
|
348
|
+
<li>Auto detect <a href="../classes/Locale.html">Locale</a> ID.
|
349
|
+
POSIX(Unix/Linux/*BSD), Win32, JRuby, CGI.
|
350
|
+
|
351
|
+
</li>
|
352
|
+
</ul>
|
353
|
+
</li>
|
354
|
+
<li>Resources
|
355
|
+
|
356
|
+
<ul>
|
357
|
+
<li>ISO 639-3 languages
|
358
|
+
|
359
|
+
</li>
|
360
|
+
<li>ISO 3166 region(countries).
|
361
|
+
|
362
|
+
</li>
|
363
|
+
</ul>
|
364
|
+
</li>
|
365
|
+
<li>Support Ruby 1.8.7, Ruby 1.9.1, JRuby 1.1.4. Tested on Win32 and Linux.
|
366
|
+
|
367
|
+
</li>
|
368
|
+
</ul>
|
369
|
+
<h2>Website</h2>
|
370
|
+
<ul>
|
371
|
+
<li><a
|
372
|
+
href="http://www.yotabanana.com/hiki/ruby-locale.html">www.yotabanana.com/hiki/ruby-locale.html</a>
|
373
|
+
|
374
|
+
</li>
|
375
|
+
<li><a href="http://locale.rubyforge.org">locale.rubyforge.org</a>/
|
376
|
+
|
377
|
+
</li>
|
378
|
+
</ul>
|
379
|
+
<h2>Requirements</h2>
|
380
|
+
<ul>
|
381
|
+
<li>Ruby-1.8.7 or later <<a
|
382
|
+
href="http://www.ruby-lang.org/ja">www.ruby-lang.org/ja</a>/>
|
383
|
+
|
384
|
+
</li>
|
385
|
+
<li>JRuby-1.1.4 or later <<a
|
386
|
+
href="http://jruby.codehaus.org">jruby.codehaus.org</a>/>
|
387
|
+
|
388
|
+
</li>
|
389
|
+
</ul>
|
390
|
+
<h2>Install</h2>
|
391
|
+
<ul>
|
392
|
+
<li>gem: ($ su)
|
393
|
+
|
394
|
+
<pre>
|
395
|
+
# gem install locale
|
396
|
+
</pre>
|
397
|
+
</li>
|
398
|
+
<li>tar-ball: Download tar-ball from <a
|
399
|
+
href="http://rubyforge.org/projects/locale">rubyforge.org/projects/locale</a>/
|
400
|
+
De-Compress archive and enter its top directory. Then type:
|
401
|
+
|
402
|
+
<pre>
|
403
|
+
($ su)
|
404
|
+
# ruby setup.rb
|
405
|
+
</pre>
|
406
|
+
</li>
|
407
|
+
</ul>
|
408
|
+
<h2>The simplest usage</h2>
|
409
|
+
<pre>
|
410
|
+
require 'rubygems'
|
411
|
+
require 'locale'
|
412
|
+
|
413
|
+
p Locale.candidates
|
414
|
+
</pre>
|
415
|
+
<h2>APIs</h2>
|
416
|
+
<p>
|
417
|
+
The most important APIs are defined in <a
|
418
|
+
href="../classes/Locale.html">Locale</a> module.
|
419
|
+
</p>
|
420
|
+
<ul>
|
421
|
+
<li><a href="../classes/Locale.html#M000012">Locale.candidates</a> - Returns
|
422
|
+
the current locale candidates.
|
423
|
+
|
424
|
+
</li>
|
425
|
+
<li><a href="../classes/Locale.html#M000011">Locale.current</a>= - Sets the
|
426
|
+
current locale(in a thread).
|
427
|
+
|
428
|
+
</li>
|
429
|
+
<li><a href="../classes/Locale.html#M000008">Locale.default</a>= - Sets the
|
430
|
+
default locale(in the whole program).
|
431
|
+
|
432
|
+
</li>
|
433
|
+
<li><a href="../classes/Locale.html#M000016">Locale.set_app_language_tags</a> -
|
434
|
+
Sets the locale that is supported by the App.
|
435
|
+
|
436
|
+
</li>
|
437
|
+
</ul>
|
438
|
+
<h2>License</h2>
|
439
|
+
<p>
|
440
|
+
This program is licenced under the same licence as Ruby. (See the file
|
441
|
+
‘COPYING’.)
|
442
|
+
</p>
|
443
|
+
<ul>
|
444
|
+
<li>locale/language.rb, locale/region.rb, locale/data/language.tab.gz,
|
445
|
+
locale/data/region.tab.gz:
|
446
|
+
|
447
|
+
<ul>
|
448
|
+
<li>Copyright (C) 2006 Brian Pontarelli, Antonio Terceiro
|
449
|
+
|
450
|
+
</li>
|
451
|
+
<li>Copyright (C) 2008 Masao Mutoh <mutomasa at gmail.com>
|
452
|
+
|
453
|
+
</li>
|
454
|
+
</ul>
|
455
|
+
</li>
|
456
|
+
<li>setup.rb version 3.4.1
|
457
|
+
|
458
|
+
<ul>
|
459
|
+
<li>Copyright (C) 2000-2005 Minero Aoki <aamine at loveruby.net>
|
460
|
+
|
461
|
+
</li>
|
462
|
+
<li>This file is released under LGPL. See the top of the setup.rb.
|
463
|
+
|
464
|
+
</li>
|
465
|
+
</ul>
|
466
|
+
</li>
|
467
|
+
<li>Others(Some files are separated from Ruby-GetText-Package-1.92.0)
|
468
|
+
|
469
|
+
<ul>
|
470
|
+
<li>Copyright (C) 2008 Masao Mutoh <mutoh at highwhay.ne.jp>
|
471
|
+
|
472
|
+
</li>
|
473
|
+
</ul>
|
474
|
+
</li>
|
475
|
+
</ul>
|
476
|
+
<h2>References</h2>
|
477
|
+
<h3>Other libraries</h3>
|
478
|
+
<ul>
|
479
|
+
<li>langtag-0.1.0
|
480
|
+
|
481
|
+
<ul>
|
482
|
+
<li>by Martin Dürst <<a
|
483
|
+
href="http://rubyforge.org/projects/langtag">rubyforge.org/projects/langtag</a>/>
|
484
|
+
|
485
|
+
</li>
|
486
|
+
</ul>
|
487
|
+
</li>
|
488
|
+
<li>memoizable.rb
|
489
|
+
|
490
|
+
<ul>
|
491
|
+
<li>from ActiveSupport-2.2.0 <<a
|
492
|
+
href="http://rubyforge.org/projects/activesupport">rubyforge.org/projects/activesupport</a>/>
|
493
|
+
|
494
|
+
</li>
|
495
|
+
</ul>
|
496
|
+
</li>
|
497
|
+
<li>Ruby-GetText-Package-1.92.0
|
498
|
+
|
499
|
+
<ul>
|
500
|
+
<li>by Masao Mutoh <<a
|
501
|
+
href="http://www.yotabanana.com/hiki/ruby-gettext.html">www.yotabanana.com/hiki/ruby-gettext.html</a>>
|
502
|
+
|
503
|
+
</li>
|
504
|
+
</ul>
|
505
|
+
</li>
|
506
|
+
</ul>
|
507
|
+
<h3>Documents</h3>
|
508
|
+
<ul>
|
509
|
+
<li>The Open Group Base Specifications Issue 6 IEEE Std 1003.1, 2004 Edition
|
510
|
+
Internationalization Variables <<a
|
511
|
+
href="http://www.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap08.html">www.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap08.html</a>>
|
512
|
+
|
513
|
+
</li>
|
514
|
+
<li>GNU `gettext’ utilities - Setting the <a
|
515
|
+
href="../classes/Locale.html">Locale</a> through Environment Variables
|
516
|
+
<<a
|
517
|
+
href="http://www.gnu.org/software/gettext/manual/gettext.html#Setting-the-POSIX-Locale">www.gnu.org/software/gettext/manual/gettext.html#Setting-the-POSIX-Locale</a>>
|
518
|
+
|
519
|
+
</li>
|
520
|
+
<li>BCP47 / RFC4646, RFC3066 - Tags for Identifying Languages (Keep RFC3066
|
521
|
+
compatibility) <<a
|
522
|
+
href="http://www.ietf.org/rfc/rfc4646.txt">www.ietf.org/rfc/rfc4646.txt</a>>
|
523
|
+
<<a
|
524
|
+
href="http://www.ietf.org/rfc/rfc3066.txt">www.ietf.org/rfc/rfc3066.txt</a>>
|
525
|
+
|
526
|
+
</li>
|
527
|
+
<li>Unicode <a href="../classes/Locale.html">Locale</a> Data Markup Language
|
528
|
+
(LDML) 1.6.1 Unicode Language and <a
|
529
|
+
href="../classes/Locale.html">Locale</a> Identifiers <<a
|
530
|
+
href="http://www.unicode.org/reports/tr35/tr35-11.html#Unicode_Language_and_Locale_Identifiers">www.unicode.org/reports/tr35/tr35-11.html#Unicode_Language_and_Locale_Identifiers</a>>
|
531
|
+
|
532
|
+
</li>
|
533
|
+
<li>JDK 6 Documentation - Java Supported Locales <<a
|
534
|
+
href="http://java.sun.com/javase/6/docs/technotes/guides/intl/locale.doc.html">java.sun.com/javase/6/docs/technotes/guides/intl/locale.doc.html</a>>
|
535
|
+
|
536
|
+
</li>
|
537
|
+
<li>Microsoft Developer Network - Locales and Languages <<a
|
538
|
+
href="http://msdn.microsoft.com/en-us/library/ms776264(VS.85).aspx">msdn.microsoft.com/en-us/library/ms776264(VS.85).aspx</a>>
|
539
|
+
|
540
|
+
</li>
|
541
|
+
<li>ISO 639
|
542
|
+
|
543
|
+
</li>
|
544
|
+
<li>ISO 3166
|
545
|
+
|
546
|
+
</li>
|
547
|
+
</ul>
|
548
|
+
<h2>Maintainer</h2>
|
549
|
+
<p>
|
550
|
+
Masao Mutoh <mutomasa at gmail.com>
|
551
|
+
</p>
|
552
|
+
</div>
|
553
|
+
|
554
|
+
|
555
|
+
|
556
|
+
|
557
|
+
<p></p>
|
558
|
+
|
559
|
+
|
560
|
+
|
561
|
+
|
562
|
+
|
563
|
+
|
564
|
+
|
565
|
+
</div><div class="clear" id="footer">Generated on May 9, 2009 / Allison 2 © 2007 <a href="http://cloudbur.st">Cloudburst, LLC</a></div></div></body></html>
|