Translations with data mapper

23 views
Skip to first unread message

David Moreland

unread,
Jul 23, 2013, 3:46:07 AM7/23/13
to datam...@googlegroups.com
Hi, 

Im not sure if this is the correct place to post or if what im trying to do is even possible.

I have a model called FooBar with a property called foo, is there a way to create a translation for this property name in the localisation files so whenever its displayed in a view or validation message it appears as bar instead of foo.

In the rails documentation they show how to do it for activerecords but i don't seem to be able to make this work with DataMapper. 


Дмитрий Новиков

unread,
Aug 14, 2013, 9:28:24 AM8/14/13
to datam...@googlegroups.com
I've created a translation file (I use r18n - https://github.com/ai/r18n) and it works! You just replace <activerecord> key with <data_mapper>.


data_mapper:
  attributes:
    user:
      confirmation_code: код
      confirmed: подтвержден
      contacts: контакты
      created_at: создан
      current_password: текущий пароль
      email: эл. адрес
      name: имя (полное)
      password: пароль
      password_confirmation: повтор пароля
      phone: телефон
      remember_me: запомнить меня
      reset_password_token: ключ
Reply all
Reply to author
Forward
0 new messages