<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -220,8 +220,6 @@ module ActionView
         end
       end
 
-      STORAGE_UNITS = %w( Bytes KB MB GB TB ).freeze
-
       # Formats the bytes in +size+ into a more understandable representation
       # (e.g., giving it 1500 yields 1.5 KB). This method is useful for
       # reporting file sizes to users. This method returns nil if
@@ -257,6 +255,7 @@ module ActionView
         defaults = I18n.translate(:'number.format', :locale =&gt; options[:locale], :raise =&gt; true) rescue {}
         human    = I18n.translate(:'number.human.format', :locale =&gt; options[:locale], :raise =&gt; true) rescue {}
         defaults = defaults.merge(human)
+        storage_units = I18n.translate(:'number.human.storage_units', :locale =&gt; options[:locale], :raise =&gt; true)
 
         unless args.empty?
           ActiveSupport::Deprecation.warn('number_to_human_size takes an option hash ' +
@@ -268,12 +267,12 @@ module ActionView
         separator ||= (options[:separator] || defaults[:separator])
         delimiter ||= (options[:delimiter] || defaults[:delimiter])
 
-        max_exp  = STORAGE_UNITS.size - 1
+        max_exp  = storage_units.size - 1
         number   = Float(number)
         exponent = (Math.log(number) / Math.log(1024)).to_i # Convert to base 1024
         exponent = max_exp if exponent &gt; max_exp # we need this to avoid overflow for the highest unit
         number  /= 1024 ** exponent
-        unit     = STORAGE_UNITS[exponent]
+        unit     = storage_units[exponent]
 
         begin
           escaped_separator = Regexp.escape(separator)</diff>
      <filename>actionpack/lib/action_view/helpers/number_helper.rb</filename>
    </modified>
    <modified>
      <diff>@@ -44,6 +44,7 @@
         # separator: 
         delimiter: &quot;&quot;
         precision: 1
+      storage_units: [Bytes, KB, MB, GB, TB]
 
   # Used in distance_of_time_in_words(), distance_of_time_in_words_to_now(), time_ago_in_words()
   datetime:</diff>
      <filename>actionpack/lib/action_view/locale/en.yml</filename>
    </modified>
    <modified>
      <diff>@@ -10,6 +10,7 @@ class NumberHelperI18nTests &lt; Test::Unit::TestCase
       @number_defaults = { :precision =&gt; 3, :delimiter =&gt; ',', :separator =&gt; '.' }
       @currency_defaults = { :unit =&gt; '$', :format =&gt; '%u%n', :precision =&gt; 2 }
       @human_defaults = { :precision =&gt; 1 }
+      @human_storage_units_defaults = %w(Bytes KB MB GB TB)
       @percentage_defaults = { :delimiter =&gt; '' }
       @precision_defaults = { :delimiter =&gt; '' }
 
@@ -47,6 +48,8 @@ class NumberHelperI18nTests &lt; Test::Unit::TestCase
       I18n.expects(:translate).with(:'number.format', :locale =&gt; 'en', :raise =&gt; true).returns(@number_defaults)
       I18n.expects(:translate).with(:'number.human.format', :locale =&gt; 'en',
                                     :raise =&gt; true).returns(@human_defaults)
+      I18n.expects(:translate).with(:'number.human.storage_units', :locale =&gt; 'en',
+                                    :raise =&gt; true).returns(@human_storage_units_defaults)
       # can't be called with 1 because this directly returns without calling I18n.translate
       number_to_human_size(1025, :locale =&gt; 'en')
     end</diff>
      <filename>actionpack/test/template/number_helper_i18n_test.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>9d4ae40bb40b2354c4061a23ae4db9a28e3174e6</id>
    </parent>
  </parents>
  <author>
    <name>Yaroslav Markin</name>
    <email>yaroslav@markin.net</email>
  </author>
  <url>http://github.com/rails/rails/commit/d36158794b19ee8ea49d74061218b37d4301f0f9</url>
  <id>d36158794b19ee8ea49d74061218b37d4301f0f9</id>
  <committed-date>2008-11-23T13:11:59-08:00</committed-date>
  <authored-date>2008-11-23T06:30:59-08:00</authored-date>
  <message>Add i18n for number_to_human_size() helper storage units. Translation key is number.human.storage_units.

[#1448 state:committed]

Signed-off-by: Jeremy Kemper &lt;jeremy@bitsweat.net&gt;</message>
  <tree>1e044f880a2aa931804e7d1674200fa68cafec19</tree>
  <committer>
    <name>Jeremy Kemper</name>
    <email>jeremy@bitsweat.net</email>
  </committer>
</commit>
