> I started the development of a I18n extension a few months ago, I
> believe it's the way to go, even talked with Dan Kubb about it but I
> was taken away by a new job, so I didn't have the time to finish it.
> I hope to have time to do that soon, but I'm not sure when :( I
> really wanted to finish it, and it had a lot of features already. I
> was unable to follow the recent developments, so I'm not sure it
> will be compatible anymore. I'd like to participate, just need to
> squeeze some time.
Well, I think I18n support should be included in dm-core. It should be
an API to be used inside DataMapper to translate internal messages
(like validation errors) and should allow writing adapters for I18n
APIs used in project. The good start would be adapters for Rails' I18n
and GetText APIs.
> The basic stuff is already done, I was starting to change it to
> support pure Ruby object translations, but stopped. I'll dig my code
> up, dust it off and try to make it run with the latest build, and
> then I'll post the link here. It's on Github but it's pretty out of
> date.
I just have noticed that datamapper/dm-more has "errors_messages_i18n"
branch, that has I18n support added by Rafael (although it adds
localization support only for several validators). It relies on Rails'
I18n API.
> It relies on I18n, but it's not a Rails exclusive library since it
> can be added as a gem, but I do believe it's the de facto
> internationalization library, specially with Rails 3 coming. Besides
> that, it's quite a well thought base to build upon. When I spoke to
> Dan Kubb he advised me to keep it under dm-validation, and I do
> believe it's a good call, since most internationalization stuff
> happens there, or at least keep it as a separate gem, so we won't
> clutter dm-core.
Well, I strongly oppose a solution that doesn't allow the end user to
choose the internationalisation library. Personally I don't want to be
forced by dm-validations to use Rails i18n (I really don't like the
API myself).
Imho we should give people a choice on what backend they use, whether
it's Rails i18n, Gettext or some other solution. Agree on the fact
that we shouldn't clutter dm-core with this stuff.
--
Regards,
Dirkjan Bussink
> On Jul 2, 1:09 pm, Dirkjan Bussink <d.buss...@gmail.com> wrote:
>
>> Well, I strongly oppose a solution that doesn't allow the end user to
>> choose the internationalisation library. Personally I don't want to
>> be
>> forced by dm-validations to use Rails i18n (I really don't like the
>> API myself).
>
> Aside from my dislike of forcing a single i18n library on everyone, is
> that if you ask any two developers what they need/want in one, you'll
> get different and often conflicting answers. There's not really any
> agreed upon approach to resolving this, which means to me there's
> still room for innovation.
Well, here is my point in support for I18n gem (which is bundled into
Rails now): if we want DataMapper to abstract from particular
internationalization API, we need to develop another API that will
allow integrating with existing APIs. But I18n gem is actually such an
API: it allows developing custom "backends" to do the translation.
Even if you use Gettext in your Rails project, you could benefit from
supplying Gettext-adaptor backend to I18n and have the ability to
localize e.g. ActiveRecord error messages.
My vote for I18n as a ready to use I18n engine abstraction API.