rails_plugins/globalite/rdoc/classes/Globalite/L10n.html in picolena-0.1.5 vs rails_plugins/globalite/rdoc/classes/Globalite/L10n.html in picolena-0.1.6

- old
+ new

@@ -1,7 +1,7 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!DOCTYPE html +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> @@ -23,23 +23,23 @@ elem = eval( "document.all." + id ); else return false; elemStyle = elem.style; - + if ( elemStyle.display != "block" ) { elemStyle.display = "block" } else { elemStyle.display = "none" } return true; } - + // Make codeblocks hidden by default document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" ) - + // ]]> </script> </head> <body> @@ -132,13 +132,13 @@ <td class="context-item-desc"></td> </tr> </table> </div> </div> - + <!-- if method_list --> <div id="methods"> <h3 class="section-bar">Public Instance methods</h3> <div id="method-M000025" class="method-detail"> @@ -147,11 +147,11 @@ <div class="method-heading"> <a href="#M000025" class="method-signature"> <span class="method-name">add_localization_source</span><span class="method-args">(path)</span> </a> </div> - + <div class="method-description"> <p><a class="source-toggle" href="#" onclick="toggleCode('M000025-source');return false;">[Source]</a></p> <div class="method-source-code" id="M000025-source"> <pre> @@ -171,11 +171,11 @@ <div class="method-heading"> <a href="#M000032" class="method-signature"> <span class="method-name">add_reserved_key</span><span class="method-args">(*key)</span> </a> </div> - + <div class="method-description"> <p><a class="source-toggle" href="#" onclick="toggleCode('M000032-source');return false;">[Source]</a></p> <div class="method-source-code" id="M000032-source"> <pre> @@ -192,11 +192,11 @@ <a name="M000033"></a> <div class="method-heading"> <span class="method-name">add_reserved_keys</span><span class="method-args">(*key)</span> </div> - + <div class="method-description"> <p> Alias for <a href="L10n.html#M000032">add_reserved_key</a> </p> </div> @@ -208,11 +208,11 @@ <div class="method-heading"> <a href="#M000014" class="method-signature"> <span class="method-name">countries</span><span class="method-args">()</span> </a> </div> - + <div class="method-description"> <p><a class="source-toggle" href="#" onclick="toggleCode('M000014-source');return false;">[Source]</a></p> <div class="method-source-code" id="M000014-source"> <pre> @@ -229,11 +229,11 @@ <a name="M000019"></a> <div class="method-heading"> <span class="method-name">country</span><span class="method-args">()</span> </div> - + <div class="method-description"> <p> Alias for <a href="L10n.html#M000018">current_country</a> </p> </div> @@ -245,11 +245,11 @@ <div class="method-heading"> <a href="#M000018" class="method-signature"> <span class="method-name">current_country</span><span class="method-args">()</span> </a> </div> - + <div class="method-description"> <p><a class="source-toggle" href="#" onclick="toggleCode('M000018-source');return false;">[Source]</a></p> <div class="method-source-code" id="M000018-source"> <pre> @@ -268,11 +268,11 @@ <div class="method-heading"> <a href="#M000023" class="method-signature"> <span class="method-name">current_country=</span><span class="method-args">(country)</span> </a> </div> - + <div class="method-description"> <p> Set the current <a href="L10n.html#M000019">country</a> code (ISO 3166 <a href="L10n.html#M000019">country</a> code in uppercase letters) Usage: Globalite.current_country = &#8216;US&#8217; or Globalite.current_country = @@ -290,24 +290,24 @@ <span class="ruby-comment cmt"># File lib/globalite/l10n.rb, line 78</span> 78: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">current_country=</span>(<span class="ruby-identifier">country</span>) 79: <span class="ruby-identifier">load_localization!</span> <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">defined?</span> <span class="ruby-constant">RAILS_ENV</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-constant">RAILS_ENV</span> <span class="ruby-operator">==</span> <span class="ruby-value str">'development'</span> 80: <span class="ruby-identifier">country</span> = <span class="ruby-identifier">country</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">upcase</span>.<span class="ruby-identifier">to_sym</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">country</span>.<span class="ruby-identifier">class</span> <span class="ruby-operator">==</span> <span class="ruby-constant">Symbol</span> 81: <span class="ruby-identifier">country</span> = <span class="ruby-identifier">country</span>.<span class="ruby-identifier">upcase</span>.<span class="ruby-identifier">to_sym</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">country</span>.<span class="ruby-identifier">class</span> <span class="ruby-operator">==</span> <span class="ruby-constant">String</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span><span class="ruby-identifier">country</span>.<span class="ruby-identifier">empty?</span> - 82: + 82: 83: <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@@locales</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-node">&quot;#{current_language}-#{country}&quot;</span>.<span class="ruby-identifier">to_sym</span>) 84: <span class="ruby-ivar">@@current_country</span> = <span class="ruby-identifier">country</span> 85: <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">locales</span>.<span class="ruby-identifier">each</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">locale</span><span class="ruby-operator">|</span> <span class="ruby-identifier">locale</span> <span class="ruby-operator">=~</span> <span class="ruby-node">/[a-z][a-z]-#{country.to_s}/</span> } - 86: <span class="ruby-identifier">locales</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">key</span><span class="ruby-operator">|</span> - 87: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">key</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">country</span>.<span class="ruby-identifier">to_s</span>) + 86: <span class="ruby-identifier">locales</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">key</span><span class="ruby-operator">|</span> + 87: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">key</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">country</span>.<span class="ruby-identifier">to_s</span>) 88: <span class="ruby-ivar">@new_language</span> = <span class="ruby-identifier">key</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">split</span>(<span class="ruby-value str">'-'</span>)[<span class="ruby-value">0</span>].<span class="ruby-identifier">downcase</span>.<span class="ruby-identifier">to_sym</span> 89: <span class="ruby-keyword kw">end</span> 90: <span class="ruby-keyword kw">end</span> 91: <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@new_language</span> - 92: <span class="ruby-ivar">@@current_language</span> = <span class="ruby-ivar">@new_language</span> - 93: <span class="ruby-ivar">@@current_country</span> = <span class="ruby-identifier">country</span> + 92: <span class="ruby-ivar">@@current_language</span> = <span class="ruby-ivar">@new_language</span> + 93: <span class="ruby-ivar">@@current_country</span> = <span class="ruby-identifier">country</span> 94: <span class="ruby-keyword kw">end</span> - 95: <span class="ruby-keyword kw">else</span> + 95: <span class="ruby-keyword kw">else</span> 96: <span class="ruby-ivar">@@current_country</span> = <span class="ruby-identifier">:*</span> 97: <span class="ruby-keyword kw">end</span> 98: <span class="ruby-constant">Locale</span>.<span class="ruby-identifier">update_session_locale</span> 99: <span class="ruby-ivar">@@current_country</span> 100: <span class="ruby-keyword kw">end</span> @@ -322,11 +322,11 @@ <div class="method-heading"> <a href="#M000016" class="method-signature"> <span class="method-name">current_language</span><span class="method-args">()</span> </a> </div> - + <div class="method-description"> <p><a class="source-toggle" href="#" onclick="toggleCode('M000016-source');return false;">[Source]</a></p> <div class="method-source-code" id="M000016-source"> <pre> @@ -345,11 +345,11 @@ <div class="method-heading"> <a href="#M000022" class="method-signature"> <span class="method-name">current_language=</span><span class="method-args">(language)</span> </a> </div> - + <div class="method-description"> <p> Set the current <a href="L10n.html#M000017">language</a> ( ISO 639-1 <a href="L10n.html#M000017">language</a> code in lowercase letters) Usage: Globalite.current_language = &#8216;fr&#8217; or Globalite.current_language @@ -361,21 +361,21 @@ onclick="toggleCode('M000022-source');return false;">[Source]</a></p> <div class="method-source-code" id="M000022-source"> <pre> <span class="ruby-comment cmt"># File lib/globalite/l10n.rb, line 54</span> 54: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">current_language=</span>(<span class="ruby-identifier">language</span>) -55: +55: 56: <span class="ruby-identifier">language</span> = <span class="ruby-identifier">language</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">downcase</span>.<span class="ruby-identifier">to_sym</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">language</span>.<span class="ruby-identifier">class</span> <span class="ruby-operator">==</span> <span class="ruby-constant">Symbol</span> 57: <span class="ruby-identifier">language</span> = <span class="ruby-identifier">language</span>.<span class="ruby-identifier">downcase</span>.<span class="ruby-identifier">to_sym</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">language</span>.<span class="ruby-identifier">class</span> <span class="ruby-operator">==</span> <span class="ruby-constant">String</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span><span class="ruby-identifier">language</span>.<span class="ruby-identifier">empty?</span> -58: +58: 59: <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@@languages</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">language</span>) 60: <span class="ruby-ivar">@@current_language</span> = <span class="ruby-identifier">language</span> 61: <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-ivar">@@locales</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-node">&quot;#{language}-#{@@current_country}&quot;</span>.<span class="ruby-identifier">to_sym</span>) 62: <span class="ruby-ivar">@@current_country</span> = <span class="ruby-identifier">:*</span> 63: <span class="ruby-keyword kw">end</span> 64: <span class="ruby-keyword kw">end</span> -65: +65: 66: <span class="ruby-constant">Locale</span>.<span class="ruby-identifier">update_session_locale</span> 67: <span class="ruby-identifier">localize_rails</span> 68: <span class="ruby-ivar">@@current_language</span> 69: <span class="ruby-keyword kw">end</span> </pre> @@ -389,11 +389,11 @@ <div class="method-heading"> <a href="#M000020" class="method-signature"> <span class="method-name">current_locale</span><span class="method-args">()</span> </a> </div> - + <div class="method-description"> <p><a class="source-toggle" href="#" onclick="toggleCode('M000020-source');return false;">[Source]</a></p> <div class="method-source-code" id="M000020-source"> <pre> @@ -412,11 +412,11 @@ <div class="method-heading"> <a href="#M000024" class="method-signature"> <span class="method-name">current_locale=</span><span class="method-args">(locale)</span> </a> </div> - + <div class="method-description"> <p><a class="source-toggle" href="#" onclick="toggleCode('M000024-source');return false;">[Source]</a></p> <div class="method-source-code" id="M000024-source"> <pre> @@ -435,11 +435,11 @@ <div class="method-heading"> <a href="#M000013" class="method-signature"> <span class="method-name">default_language</span><span class="method-args">()</span> </a> </div> - + <div class="method-description"> <p><a class="source-toggle" href="#" onclick="toggleCode('M000013-source');return false;">[Source]</a></p> <div class="method-source-code" id="M000013-source"> <pre> @@ -456,11 +456,11 @@ <a name="M000031"></a> <div class="method-heading"> <span class="method-name">l_with_args</span><span class="method-args">(key, args={})</span> </div> - + <div class="method-description"> <p> Alias for <a href="L10n.html#M000030">localize_with_args</a> </p> </div> @@ -470,11 +470,11 @@ <a name="M000017"></a> <div class="method-heading"> <span class="method-name">language</span><span class="method-args">()</span> </div> - + <div class="method-description"> <p> Alias for <a href="L10n.html#M000016">current_language</a> </p> </div> @@ -486,11 +486,11 @@ <div class="method-heading"> <a href="#M000012" class="method-signature"> <span class="method-name">languages</span><span class="method-args">()</span> </a> </div> - + <div class="method-description"> <p><a class="source-toggle" href="#" onclick="toggleCode('M000012-source');return false;">[Source]</a></p> <div class="method-source-code" id="M000012-source"> <pre> @@ -509,11 +509,11 @@ <div class="method-heading"> <a href="#M000035" class="method-signature"> <span class="method-name">load_localization!</span><span class="method-args">()</span> </a> </div> - + <div class="method-description"> <p> Loads ALL the UI localization in memory, I might want to refactor this later on. (can be hard on the memory if you load 25 <a href="L10n.html#M000012">languages</a> with 900 strings in each) @@ -523,11 +523,11 @@ <div class="method-source-code" id="M000035-source"> <pre> <span class="ruby-comment cmt"># File lib/globalite/l10n.rb, line 154</span> 154: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">load_localization!</span> 155: <span class="ruby-identifier">reset_l10n_data</span> -156: +156: 157: <span class="ruby-comment cmt"># Load the rails localization</span> 158: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">rails_localization_files</span> 159: <span class="ruby-identifier">rails_localization_files</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">file</span><span class="ruby-operator">|</span> 160: <span class="ruby-identifier">lang</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">basename</span>(<span class="ruby-identifier">file</span>, <span class="ruby-value str">'.*'</span>)[<span class="ruby-value">0</span>,<span class="ruby-value">2</span>].<span class="ruby-identifier">downcase</span>.<span class="ruby-identifier">to_sym</span> 161: <span class="ruby-comment cmt"># if a country is defined</span> @@ -538,21 +538,21 @@ 166: <span class="ruby-keyword kw">else</span> 167: <span class="ruby-ivar">@@locales</span>[<span class="ruby-node">&quot;#{lang}-#{country}&quot;</span>.<span class="ruby-identifier">to_sym</span>] = <span class="ruby-constant">YAML</span>.<span class="ruby-identifier">load_file</span>(<span class="ruby-identifier">file</span>).<span class="ruby-identifier">symbolize_keys</span> 168: <span class="ruby-keyword kw">end</span> 169: <span class="ruby-ivar">@@languages</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">lang</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@@languages</span>.<span class="ruby-identifier">include?</span> <span class="ruby-identifier">lang</span> 170: <span class="ruby-keyword kw">else</span> -171: <span class="ruby-ivar">@@languages</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">lang</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@@languages</span>.<span class="ruby-identifier">include?</span> <span class="ruby-identifier">lang</span> +171: <span class="ruby-ivar">@@languages</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">lang</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@@languages</span>.<span class="ruby-identifier">include?</span> <span class="ruby-identifier">lang</span> 172: <span class="ruby-ivar">@f_locale</span> = <span class="ruby-node">&quot;#{lang}-*&quot;</span>.<span class="ruby-identifier">to_sym</span> 173: <span class="ruby-ivar">@@locales</span>[<span class="ruby-ivar">@f_locale</span>] = <span class="ruby-ivar">@@locales</span>[<span class="ruby-ivar">@f_locale</span>].<span class="ruby-identifier">merge</span>(<span class="ruby-constant">YAML</span>.<span class="ruby-identifier">load_file</span>(<span class="ruby-identifier">file</span>).<span class="ruby-identifier">symbolize_keys</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">locales</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-ivar">@f_locale</span>) 174: <span class="ruby-ivar">@@locales</span>[<span class="ruby-ivar">@f_locale</span>] = <span class="ruby-constant">YAML</span>.<span class="ruby-identifier">load_file</span>(<span class="ruby-identifier">file</span>).<span class="ruby-identifier">symbolize_keys</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">locales</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-ivar">@f_locale</span>) 175: <span class="ruby-keyword kw">end</span> 176: <span class="ruby-keyword kw">end</span> 177: <span class="ruby-keyword kw">end</span> -178: +178: 179: <span class="ruby-comment cmt"># Load the UI localization</span> 180: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">ui_localization_files</span> -181: <span class="ruby-identifier">ui_localization_files</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">file</span><span class="ruby-operator">|</span> +181: <span class="ruby-identifier">ui_localization_files</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">file</span><span class="ruby-operator">|</span> 182: <span class="ruby-identifier">lang</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">basename</span>(<span class="ruby-identifier">file</span>, <span class="ruby-value str">'.*'</span>)[<span class="ruby-value">0</span>,<span class="ruby-value">2</span>].<span class="ruby-identifier">downcase</span>.<span class="ruby-identifier">to_sym</span> 183: <span class="ruby-keyword kw">if</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">basename</span>(<span class="ruby-identifier">file</span>, <span class="ruby-value str">'.*'</span>)[<span class="ruby-value">3</span>,<span class="ruby-value">5</span>] 184: <span class="ruby-identifier">country</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">basename</span>(<span class="ruby-identifier">file</span>, <span class="ruby-value str">'.*'</span>)[<span class="ruby-value">3</span>,<span class="ruby-value">5</span>].<span class="ruby-identifier">upcase</span>.<span class="ruby-identifier">to_sym</span> 185: <span class="ruby-keyword kw">else</span> 186: <span class="ruby-identifier">country</span> = <span class="ruby-value str">'*'</span>.<span class="ruby-identifier">to_sym</span> @@ -560,11 +560,11 @@ 188: <span class="ruby-ivar">@@languages</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">lang</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@@languages</span>.<span class="ruby-identifier">include?</span> <span class="ruby-identifier">lang</span> 189: <span class="ruby-ivar">@@countries</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">country</span> <span class="ruby-keyword kw">if</span> ( <span class="ruby-identifier">country</span> <span class="ruby-operator">!=</span> <span class="ruby-identifier">:*</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span><span class="ruby-ivar">@@countries</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">country</span>) ) 190: <span class="ruby-ivar">@file_locale</span> = <span class="ruby-node">&quot;#{lang}-#{country}&quot;</span>.<span class="ruby-identifier">to_sym</span> 191: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">locales</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-ivar">@file_locale</span>) 192: <span class="ruby-ivar">@@locales</span>[<span class="ruby-ivar">@file_locale</span>] = <span class="ruby-ivar">@@locales</span>[<span class="ruby-ivar">@file_locale</span>].<span class="ruby-identifier">merge</span>(<span class="ruby-constant">YAML</span>.<span class="ruby-identifier">load_file</span>(<span class="ruby-identifier">file</span>).<span class="ruby-identifier">symbolize_keys</span>) -193: <span class="ruby-keyword kw">else</span> +193: <span class="ruby-keyword kw">else</span> 194: <span class="ruby-ivar">@@locales</span>[<span class="ruby-ivar">@file_locale</span>] = <span class="ruby-constant">YAML</span>.<span class="ruby-identifier">load_file</span>(<span class="ruby-identifier">file</span>).<span class="ruby-identifier">symbolize_keys</span> 195: <span class="ruby-keyword kw">end</span> 196: <span class="ruby-keyword kw">end</span> 197: <span class="ruby-keyword kw">end</span> 198: <span class="ruby-identifier">localize_rails</span> @@ -580,11 +580,11 @@ <a name="M000029"></a> <div class="method-heading"> <span class="method-name">loc</span><span class="method-args">(key, string='__localization_missing__', args={})</span> </div> - + <div class="method-description"> <p> Alias for <a href="L10n.html#M000028">localize</a> </p> </div> @@ -594,11 +594,11 @@ <a name="M000021"></a> <div class="method-heading"> <span class="method-name">locale</span><span class="method-args">()</span> </div> - + <div class="method-description"> <p> Alias for <a href="L10n.html#M000020">current_locale</a> </p> </div> @@ -610,11 +610,11 @@ <div class="method-heading"> <a href="#M000015" class="method-signature"> <span class="method-name">locales</span><span class="method-args">()</span> </a> </div> - + <div class="method-description"> <p><a class="source-toggle" href="#" onclick="toggleCode('M000015-source');return false;">[Source]</a></p> <div class="method-source-code" id="M000015-source"> <pre> @@ -633,11 +633,11 @@ <div class="method-heading"> <a href="#M000026" class="method-signature"> <span class="method-name">localization_sources</span><span class="method-args">()</span> </a> </div> - + <div class="method-description"> <p><a class="source-toggle" href="#" onclick="toggleCode('M000026-source');return false;">[Source]</a></p> <div class="method-source-code" id="M000026-source"> <pre> @@ -656,11 +656,11 @@ <div class="method-heading"> <a href="#M000027" class="method-signature"> <span class="method-name">localizations</span><span class="method-args">()</span> </a> </div> - + <div class="method-description"> <p> List <a href="L10n.html#M000027">localizations</a> for the current <a href="L10n.html#M000021">locale</a> </p> @@ -668,16 +668,16 @@ onclick="toggleCode('M000027-source');return false;">[Source]</a></p> <div class="method-source-code" id="M000027-source"> <pre> <span class="ruby-comment cmt"># File lib/globalite/l10n.rb, line 117</span> 117: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">localizations</span> -118: <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">locales</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-constant">Locale</span>.<span class="ruby-identifier">code</span>) +118: <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">locales</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-constant">Locale</span>.<span class="ruby-identifier">code</span>) 119: <span class="ruby-identifier">locales</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">key</span><span class="ruby-operator">|</span> <span class="ruby-ivar">@t_locale</span> = <span class="ruby-identifier">key</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">key</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-node">&quot;#{@@current_language.to_s}&quot;</span>) } 120: <span class="ruby-ivar">@@locales</span>[<span class="ruby-ivar">@t_locale</span>] <span class="ruby-operator">||</span> {} -121: <span class="ruby-keyword kw">else</span> +121: <span class="ruby-keyword kw">else</span> 122: <span class="ruby-ivar">@@locales</span>[<span class="ruby-constant">Locale</span>.<span class="ruby-identifier">code</span>] <span class="ruby-operator">||</span> {} -123: <span class="ruby-keyword kw">end</span> +123: <span class="ruby-keyword kw">end</span> 124: <span class="ruby-keyword kw">end</span> </pre> </div> </div> </div> @@ -688,11 +688,11 @@ <div class="method-heading"> <a href="#M000028" class="method-signature"> <span class="method-name">localize</span><span class="method-args">(key, string='__localization_missing__', args={})</span> </a> </div> - + <div class="method-description"> <p> Returns the translation for the key, a string can be passed to replaced a missing translation TODO support interpolation of passed arguments </p> @@ -718,11 +718,11 @@ <div class="method-heading"> <a href="#M000030" class="method-signature"> <span class="method-name">localize_with_args</span><span class="method-args">(key, args={})</span> </a> </div> - + <div class="method-description"> <p><a class="source-toggle" href="#" onclick="toggleCode('M000030-source');return false;">[Source]</a></p> <div class="method-source-code" id="M000030-source"> <pre> @@ -741,11 +741,11 @@ <div class="method-heading"> <a href="#M000034" class="method-signature"> <span class="method-name">reset_l10n_data</span><span class="method-args">()</span> </a> </div> - + <div class="method-description"> <p><a class="source-toggle" href="#" onclick="toggleCode('M000034-source');return false;">[Source]</a></p> <div class="method-source-code" id="M000034-source"> <pre> @@ -768,11 +768,11 @@ <div class="method-heading"> <a href="#M000038" class="method-signature"> <span class="method-name">interpolate_string</span><span class="method-args">(string, args={})</span> </a> </div> - + <div class="method-description"> <p><a class="source-toggle" href="#" onclick="toggleCode('M000038-source');return false;">[Source]</a></p> <div class="method-source-code" id="M000038-source"> <pre> @@ -796,11 +796,11 @@ <div class="method-heading"> <a href="#M000037" class="method-signature"> <span class="method-name">rails_localization_files</span><span class="method-args">()</span> </a> </div> - + <div class="method-description"> <p> Rails localization files, doesn&#8216;t support <a href="L10n.html#M000015">locales</a>, only 1 file per <a href="L10n.html#M000017">language</a> @@ -824,10 +824,10 @@ <div class="method-heading"> <a href="#M000036" class="method-signature"> <span class="method-name">ui_localization_files</span><span class="method-args">()</span> </a> </div> - + <div class="method-description"> <p><a class="source-toggle" href="#" onclick="toggleCode('M000036-source');return false;">[Source]</a></p> <div class="method-source-code" id="M000036-source"> <pre> \ No newline at end of file