Capture translatable properties on the TranslationProxy
Capture translatable properties on the TranslationProxy

The block passed to #translatable is now being
instance_eval'ed on the TranslationProxy instead
of previously being class_eval'ed on the generated
translation model.

This means a few things:

1) The only DataMapper::Model API method available
   inside the block is #property. Actually, it's a
   small shim that will later be used to define the
   captured properties on the generated translation
   model.

   That's an advantage imo, because really the
   only purpose of the #translatable method is
   to define translatable properties. Having the
   block being class_eval'ed inside the generated
   translation model meant that the complete
   DataMapper::Model API was available inside the
   block, therefore making it possible to do too
   much more during the call to #translatable.

   Of course it's still possible to access the
   translation model programmatically. Here's an
   example

   class Item
     include DataMapper::Resource
     property :id, Serial
     translatable do
       property :name, String
       property :desc, Text
     end
     i18n.translation_model.class_eval do
       property :created_at, DateTime
       property :updated_at, DateTime
     end
   end

2) It allows us to safely capture all translatable
   properties without maintaining a (potentially
   incomplete) list of not translatable properties
   (e.g. timestamps or whatever else users come up
   with)

   This is important for at least two reasons:

   * The plugin itself needs to define overwritten
     property readers that accept a locale tag.

   * Translation UIs need a way to get at all
     translatable properties in order to be able
     to capture human entered translations

3) It moves the responsibility of tracking the
   translatable properties to the TranslationProxy
   instead of cluttering the model level API (only)
   for translation models.
snusnu/dm-is-localizable