Hi,
Joshua Sierles and myself have started work on adding hooks into rails edge to provide a common api for plugin developers working on internationalizing or localizing rails.
What's in the patch is very rough and only meant to be considered as a peek at the direction were taking. Right now we're looking for feedback before we push on any further.
What's there:
- Inclusion of a .t method into String/Time/Date/DateTime (via activesupport)
- Very basic default implementation of .t for english strings.
- If no args are supplied, it's a noop as the same string is returned
- Argments:
- Integer -> Singularize/Pluralize string
- String -> Basic interpolation (multiple)
- Symbol -> Namespaces (just swallowed in default impl.)
- Array -> Combination of above
- Very basic tests for .t method implementations (Mostly focussing on String right now)
- Modification of the following areas:
- active_record_helper.rb#error_messages_for
- date_helper#distance_of_time_in_words
- AR:Validations
- All tests that currently pass (actionpack/activesupport/activerecord) still pass with this patch.
So we'd appreciate it if people interested in this issue take a peek (patched against r7661) and provide us with plenty of feedback (+ve/-ve).
Regards,
Saimon Moore
(Globalize for Rails plugin developer)