locale_rails 0.1.0 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/ChangeLog +10 -4
- data/{README → README.rdoc} +6 -1
- data/Rakefile +8 -7
- data/lib/locale_rails.rb +3 -1
- data/lib/locale_rails/action_controller.rb +4 -130
- data/lib/locale_rails/action_controller/base.rb +85 -0
- data/lib/locale_rails/action_controller/caching.rb +49 -0
- data/lib/locale_rails/action_controller/test_process.rb +44 -0
- data/lib/locale_rails/action_view.rb +10 -12
- data/lib/locale_rails/i18n.rb +20 -1
- data/lib/locale_rails/version.rb +3 -3
- data/replace.rb +21 -0
- data/sample/app/views/samples/index.html.erb +14 -5
- data/sample/app/views/samples/index.pt.html.erb +16 -0
- data/sample/app/views/samples/index_uz_UZ.html.erb +4 -3
- data/sample/config/environment.rb +1 -1
- data/sample/config/locales/en.yml +2 -0
- data/sample/config/locales/ja.yml +2 -0
- data/sample/db/development.sqlite3 +0 -0
- data/sample/db/schema.rb +10 -0
- data/sample/db/test.sqlite3 +0 -0
- data/sample/log/development.log +1492 -2273
- metadata +17 -47
- data/NEWS +0 -7
- data/doc/classes/ActionController/Base.html +0 -442
- data/doc/classes/ActionController/Caching.html +0 -348
- data/doc/classes/ActionController/Caching/Fragments.html +0 -424
- data/doc/classes/ActionView/Base.html +0 -422
- data/doc/classes/I18n.html +0 -492
- data/doc/classes/Locale.html +0 -364
- data/doc/created.rid +0 -1
- data/doc/files/ChangeLog.html +0 -355
- data/doc/files/README.html +0 -409
- data/doc/files/lib/locale_rails/action_controller_rb.html +0 -349
- data/doc/files/lib/locale_rails/action_view_rb.html +0 -349
- data/doc/files/lib/locale_rails/i18n_rb.html +0 -342
- data/doc/files/lib/locale_rails/version_rb.html +0 -342
- data/doc/files/lib/locale_rails_rb.html +0 -349
- data/doc/fr_class_index.html +0 -7
- data/doc/fr_file_index.html +0 -8
- data/doc/fr_method_index.html +0 -11
- data/doc/index.html +0 -1
- data/doc/rdoc-style.css +0 -320
- data/locale_rails-0.1.0.gem +0 -0
- data/sample/app/views/samples/#cookie.rb# +0 -3
- data/sample/db/production.sqlite3 +0 -0
- data/sample/log/production.log +0 -80
@@ -1,422 +0,0 @@
|
|
1
|
-
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head><meta content="text/html; charset=utf-8" http-equiv="Content-Type"/><title>Class: ActionView::Base</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
|
-
</p><span><h1 id="title">
|
319
|
-
Class: ActionView::Base
|
320
|
-
</h1></span>
|
321
|
-
</div><div class="clear"></div><div id="left">
|
322
|
-
<div class="navigation darker top" id="child_of"><h3>Child of</h3><span>
|
323
|
-
|
324
|
-
Object
|
325
|
-
</span></div>
|
326
|
-
|
327
|
-
<div class="navigation darker top" id="defined_in"><h3>Defined in</h3>
|
328
|
-
|
329
|
-
<a href="../../files/lib/locale_rails/action_view_rb.html">lib/locale_rails/action_view.rb</a>
|
330
|
-
|
331
|
-
</div>
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
<div class="navigation top" id="methods"><h3>Methods</h3>
|
336
|
-
|
337
|
-
|
338
|
-
<a href='#M000006'>
|
339
|
-
_pick_template_with_locale<br/>
|
340
|
-
</a>
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
<a href='#M000005'>
|
346
|
-
_pick_template_with_locale_main<br/>
|
347
|
-
</a>
|
348
|
-
|
349
|
-
|
350
|
-
</div>
|
351
|
-
<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 onclick="toggle('class'); toggleText('class_link'); return false;" href="#" 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 onclick="toggle('file'); toggleText('file_link'); return false;" href="#" 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 onclick="toggle('method'); toggleText('method_link'); return false;" href="#" 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">
|
352
|
-
<h1 id="item_name">Class: ActionView::Base</h1>
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
<p></p>
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
<h1>Public Instance Methods</h1>
|
366
|
-
|
367
|
-
|
368
|
-
<a class="small" name="M000006"><br/></a>
|
369
|
-
<div class="method_block"><h3>
|
370
|
-
<a href='#M000006'>
|
371
|
-
|
372
|
-
|
373
|
-
_pick_template_with_locale
|
374
|
-
|
375
|
-
(template_path)
|
376
|
-
|
377
|
-
</a>
|
378
|
-
</h3>
|
379
|
-
|
380
|
-
<p class="source_link" id="M000006-show-link"><a onclick="toggle('M000006-source'); toggleText('M000006-link'); return false;" href="#" id="M000006-link">Show source...</a></p><div class="source" id="M000006-source"><pre> <span class="ruby-comment cmt"># File lib/locale_rails/action_view.rb, line 37</span>
|
381
|
-
37: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">_pick_template_with_locale</span>(<span class="ruby-identifier">template_path</span>) <span class="ruby-comment cmt">#: shouldn't memoize.</span>
|
382
|
-
38: <span class="ruby-identifier">_pick_template_with_locale_main</span>(<span class="ruby-identifier">template_path</span>, <span class="ruby-constant">I18n</span>.<span class="ruby-identifier">candidates</span>)
|
383
|
-
39: <span class="ruby-keyword kw">end</span></pre></div>
|
384
|
-
</div>
|
385
|
-
|
386
|
-
<a class="small" name="M000005"><br/></a>
|
387
|
-
<div class="method_block"><h3>
|
388
|
-
<a href='#M000005'>
|
389
|
-
|
390
|
-
|
391
|
-
_pick_template_with_locale_main
|
392
|
-
|
393
|
-
(template_path, tags)
|
394
|
-
|
395
|
-
</a>
|
396
|
-
</h3>
|
397
|
-
|
398
|
-
<p class="source_link" id="M000005-show-link"><a onclick="toggle('M000005-source'); toggleText('M000005-link'); return false;" href="#" id="M000005-link">Show source...</a></p><div class="source" id="M000005-source"><pre> <span class="ruby-comment cmt"># File lib/locale_rails/action_view.rb, line 18</span>
|
399
|
-
18: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">_pick_template_with_locale_main</span>(<span class="ruby-identifier">template_path</span>, <span class="ruby-identifier">tags</span>)
|
400
|
-
19: <span class="ruby-identifier">path</span> = <span class="ruby-identifier">template_path</span>.<span class="ruby-identifier">sub</span>(<span class="ruby-regexp re">/^\//</span>, <span class="ruby-value str">''</span>)
|
401
|
-
20: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">m</span> = <span class="ruby-identifier">path</span>.<span class="ruby-identifier">match</span>(<span class="ruby-regexp re">/(.*)\.(\w+)$/</span>)
|
402
|
-
21: <span class="ruby-identifier">template_file_name</span>, <span class="ruby-identifier">template_file_extension</span> = <span class="ruby-identifier">m</span>[<span class="ruby-value">1</span>], <span class="ruby-identifier">m</span>[<span class="ruby-value">2</span>]
|
403
|
-
22: <span class="ruby-keyword kw">else</span>
|
404
|
-
23: <span class="ruby-identifier">template_file_name</span> = <span class="ruby-identifier">path</span>
|
405
|
-
24: <span class="ruby-keyword kw">end</span>
|
406
|
-
25:
|
407
|
-
26: <span class="ruby-identifier">tags</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">v</span><span class="ruby-operator">|</span>
|
408
|
-
27: <span class="ruby-identifier">file_name</span> = <span class="ruby-node">"#{template_file_name}_#{v}"</span>
|
409
|
-
28: <span class="ruby-keyword kw">begin</span>
|
410
|
-
29: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">_pick_template_without_locale</span>(<span class="ruby-identifier">file_name</span>)
|
411
|
-
30: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">MissingTemplate</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">e</span>
|
412
|
-
31: <span class="ruby-keyword kw">end</span>
|
413
|
-
32: <span class="ruby-keyword kw">end</span>
|
414
|
-
33: <span class="ruby-identifier">_pick_template_without_locale</span>(<span class="ruby-identifier">template_path</span>)
|
415
|
-
34: <span class="ruby-keyword kw">end</span></pre></div>
|
416
|
-
</div>
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
</div><div class="clear" id="footer">Generated on Jan 21, 2008 / Allison 2 © 2007 <a href="http://cloudbur.st">Cloudburst, LLC</a></div></div></body></html>
|
data/doc/classes/I18n.html
DELETED
@@ -1,492 +0,0 @@
|
|
1
|
-
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head><meta content="text/html; charset=utf-8" http-equiv="Content-Type"/><title>Module: I18n</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
|
-
</p><span><h1 id="title">
|
319
|
-
Module: I18n
|
320
|
-
</h1></span>
|
321
|
-
</div><div class="clear"></div><div id="left">
|
322
|
-
|
323
|
-
<div class="navigation darker top" id="defined_in"><h3>Defined in</h3>
|
324
|
-
|
325
|
-
<a href="../files/lib/locale_rails/i18n_rb.html">lib/locale_rails/i18n.rb</a>
|
326
|
-
|
327
|
-
</div>
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
<div class="navigation top" id="methods"><h3>Methods</h3>
|
332
|
-
|
333
|
-
|
334
|
-
<a href='#M000010'>
|
335
|
-
candidates<br/>
|
336
|
-
</a>
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
<a href='#M000009'>
|
342
|
-
locale=<br/>
|
343
|
-
</a>
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
<a href='#M000007'>
|
349
|
-
supported_locales<br/>
|
350
|
-
</a>
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
<a href='#M000008'>
|
356
|
-
supported_locales=<br/>
|
357
|
-
</a>
|
358
|
-
|
359
|
-
|
360
|
-
</div>
|
361
|
-
<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 onclick="toggle('class'); toggleText('class_link'); return false;" href="#" 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 onclick="toggle('file'); toggleText('file_link'); return false;" href="#" 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 onclick="toggle('method'); toggleText('method_link'); return false;" href="#" 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">
|
362
|
-
<h1 id="item_name">Module: I18n</h1>
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
<p></p>
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
<h1>Public Instance Methods</h1>
|
376
|
-
|
377
|
-
|
378
|
-
<a class="small" name="M000010"><br/></a>
|
379
|
-
<div class="method_block"><h3>
|
380
|
-
<a href='#M000010'>
|
381
|
-
|
382
|
-
|
383
|
-
candidates
|
384
|
-
|
385
|
-
(type = :common)
|
386
|
-
|
387
|
-
</a>
|
388
|
-
</h3>
|
389
|
-
<p>
|
390
|
-
Get the locale <a href="I18n.html#M000010">candidates</a> as a
|
391
|
-
Locale::TagList. This is the utility function which calls Locale.candidates
|
392
|
-
with supported_language_tags.
|
393
|
-
</p>
|
394
|
-
<p>
|
395
|
-
I18n.locale is also overrided by Ruby-<a href="Locale.html">Locale</a> and
|
396
|
-
it returns the result of this method with :rfc option.
|
397
|
-
</p>
|
398
|
-
<p>
|
399
|
-
<tt>type</tt> :simple, :common(default), :rfc, :cldr.
|
400
|
-
</p>
|
401
|
-
<p>
|
402
|
-
This is used by Rails application, but it may be better not to use this
|
403
|
-
method in Rails plugins/libraries, because they have their own supported
|
404
|
-
languages.
|
405
|
-
</p>
|
406
|
-
|
407
|
-
<p class="source_link" id="M000010-show-link"><a onclick="toggle('M000010-source'); toggleText('M000010-link'); return false;" href="#" id="M000010-link">Show source...</a></p><div class="source" id="M000010-source"><pre> <span class="ruby-comment cmt"># File lib/locale_rails/i18n.rb, line 47</span>
|
408
|
-
47: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">candidates</span>(<span class="ruby-identifier">type</span> = <span class="ruby-identifier">:common</span>)
|
409
|
-
48: <span class="ruby-identifier">default</span> = [<span class="ruby-constant">I18n</span>.<span class="ruby-identifier">default_locale</span>.<span class="ruby-identifier">to_s</span>]
|
410
|
-
49: <span class="ruby-identifier">default</span> = [<span class="ruby-value str">"en-US"</span>, <span class="ruby-value str">"en"</span>] <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">default</span>[<span class="ruby-value">0</span>] <span class="ruby-operator">==</span> <span class="ruby-value str">"en-US"</span>
|
411
|
-
50: <span class="ruby-constant">Locale</span>.<span class="ruby-identifier">candidates</span>(<span class="ruby-identifier">:type</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">type</span>,
|
412
|
-
51: <span class="ruby-identifier">:supported_language_tags</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">supported_locales</span>,
|
413
|
-
52: <span class="ruby-identifier">:default_language_tags</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">default</span>)
|
414
|
-
53: <span class="ruby-keyword kw">end</span></pre></div>
|
415
|
-
</div>
|
416
|
-
|
417
|
-
<a class="small" name="M000009"><br/></a>
|
418
|
-
<div class="method_block"><h3>
|
419
|
-
<a href='#M000009'>
|
420
|
-
|
421
|
-
|
422
|
-
locale=
|
423
|
-
|
424
|
-
(tag)
|
425
|
-
|
426
|
-
</a>
|
427
|
-
</h3>
|
428
|
-
<p>
|
429
|
-
Sets the locale.
|
430
|
-
</p>
|
431
|
-
<pre>
|
432
|
-
I18n.locale = "ja-JP"
|
433
|
-
</pre>
|
434
|
-
|
435
|
-
<p class="source_link" id="M000009-show-link"><a onclick="toggle('M000009-source'); toggleText('M000009-link'); return false;" href="#" id="M000009-link">Show source...</a></p><div class="source" id="M000009-source"><pre> <span class="ruby-comment cmt"># File lib/locale_rails/i18n.rb, line 29</span>
|
436
|
-
29: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">locale=</span>(<span class="ruby-identifier">tag</span>)
|
437
|
-
30: <span class="ruby-constant">Locale</span>.<span class="ruby-identifier">clear</span>
|
438
|
-
31: <span class="ruby-constant">Locale</span>.<span class="ruby-identifier">current</span> = <span class="ruby-identifier">tag</span>
|
439
|
-
32: <span class="ruby-constant">Thread</span>.<span class="ruby-identifier">current</span>[<span class="ruby-identifier">:locale</span>] = <span class="ruby-identifier">candidates</span>(<span class="ruby-identifier">:rfc</span>)[<span class="ruby-value">0</span>]
|
440
|
-
33: <span class="ruby-keyword kw">end</span></pre></div>
|
441
|
-
</div>
|
442
|
-
|
443
|
-
<a class="small" name="M000007"><br/></a>
|
444
|
-
<div class="method_block"><h3>
|
445
|
-
<a href='#M000007'>
|
446
|
-
|
447
|
-
|
448
|
-
supported_locales
|
449
|
-
|
450
|
-
()
|
451
|
-
|
452
|
-
</a>
|
453
|
-
</h3>
|
454
|
-
<p>
|
455
|
-
Gets the supported locales.
|
456
|
-
</p>
|
457
|
-
|
458
|
-
<p class="source_link" id="M000007-show-link"><a onclick="toggle('M000007-source'); toggleText('M000007-link'); return false;" href="#" id="M000007-link">Show source...</a></p><div class="source" id="M000007-source"><pre> <span class="ruby-comment cmt"># File lib/locale_rails/i18n.rb, line 17</span>
|
459
|
-
17: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">supported_locales</span>
|
460
|
-
18: <span class="ruby-ivar">@@supported_locales</span>
|
461
|
-
19: <span class="ruby-keyword kw">end</span></pre></div>
|
462
|
-
</div>
|
463
|
-
|
464
|
-
<a class="small" name="M000008"><br/></a>
|
465
|
-
<div class="method_block"><h3>
|
466
|
-
<a href='#M000008'>
|
467
|
-
|
468
|
-
|
469
|
-
supported_locales=
|
470
|
-
|
471
|
-
(tags)
|
472
|
-
|
473
|
-
</a>
|
474
|
-
</h3>
|
475
|
-
<p>
|
476
|
-
Sets the supported locales as an Array.
|
477
|
-
</p>
|
478
|
-
<pre>
|
479
|
-
I18n.supported_locales = ["ja-JP", "ko-KR"]
|
480
|
-
</pre>
|
481
|
-
|
482
|
-
<p class="source_link" id="M000008-show-link"><a onclick="toggle('M000008-source'); toggleText('M000008-link'); return false;" href="#" id="M000008-link">Show source...</a></p><div class="source" id="M000008-source"><pre> <span class="ruby-comment cmt"># File lib/locale_rails/i18n.rb, line 23</span>
|
483
|
-
23: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">supported_locales=</span>(<span class="ruby-identifier">tags</span>)
|
484
|
-
24: <span class="ruby-ivar">@@supported_locales</span> = <span class="ruby-identifier">tags</span>
|
485
|
-
25: <span class="ruby-keyword kw">end</span></pre></div>
|
486
|
-
</div>
|
487
|
-
|
488
|
-
|
489
|
-
|
490
|
-
|
491
|
-
|
492
|
-
</div><div class="clear" id="footer">Generated on Jan 21, 2008 / Allison 2 © 2007 <a href="http://cloudbur.st">Cloudburst, LLC</a></div></div></body></html>
|