This project is archived and is in readonly mode.
number_to_human_size helper: fix/introduce pluralization, add 'format' property
-
Yaroslav Markin
Needs more discussion.
Since it fixes a bug anyway, in case we don't come up with a better solution, we should apply this to 2.3.
-
Yaroslav Markin
Sven suggested that translations table should look different, so here we are.
This way we don't do "random" lookups to translation table for getting max_exp, but a number of possible units is limited by a constant and values in translation table.
-
Yaroslav Markin
- Assigned user changed from Jeremy Kemper to Sven Fuchs
-
Yaroslav Markin
- Tag changed from actionview, helpers, i18n, patch to 2.3, actionview, bug, helpers, i18n, patch
Sven: ping
-
Pratik
- Milestone cleared.
-
Sven Fuchs
Haven't run the tests, but yeah, I think this is the way to go (using pluralization, i.e. the second approach).
Yaroslav, looking at the translation data - Byte/Bytes is the only pluralized bit. Will the code still work when one adds Kilobyte/Kilobytes?
Also, should the key be renamed to : storage_units_abbrevations?
-
Yaroslav Markin
Sven, yes, all keys are ready for pluralization, I pass
:countall the time.Regarding @:storage_units_abbreviations@, that is exactly the reason I don't like to name the key "abbreviations" -- you actually may change "KB" to "Kilobyte"/"Kilobytes" anytime :)
-
Sven Fuchs
Alright, cool. Yeah, then I think we should go with this solution.
+1 from me
-
Sven Fuchs
- Assigned user changed from Sven Fuchs to Jeremy Kemper
Jeremy, I'll assign this to you, so you know there's something to apply :)
-
Repository
- State changed from new to committed
(from [17db28f1ca0597fa1e9abdcacd934ca27d589fb9]) Improve i18n support for number_to_human_size helper: * now using pluralization properly * storage unit translations moved to number.human.storage_units.units * introduced number.human.storage_units.format for languages that do not follow "{{number}} {{unit}}" format (Japanese)
NOTE: I18n table changed, you will need to update your translations.
[#1634 number_to_human_size helper: fix/introduce pluralization, add 'format' property state:committed]
Signed-off-by: Jeremy Kemper jeremy@bitsweat.net http://github.com/rails/rails/co...
