#25 new
Lucas de Castro

Fix AR attribute translations

Reported by Lucas de Castro | May 1st, 2009 @ 03:16 AM

ActiveRecord#human_attribute_name aren't working fine.

Open a rails console and run the following code:


require 'test/unit'

include Test::Unit::Assertions

class Person < ActiveRecord::Base; end

I18n.backend.store_translations :pt,
  :activerecord => {
    :models => {
      :person => 'Pessoa',
      :attributes => {
        :person => {:name => 'Nome'}
      }
    }
  }

assert_equal 'Person', Person.human_name
assert_equal 'Name', Person.human_attribute_name('name')

I18n.locale = :pt

assert_equal 'Pessoa', Person.human_name
assert_equal 'Nome', I18n.t('activerecord.models.attributes.person.name')
assert_equal 'Nome', Person.human_attribute_name('name') # fail

Comments and changes to this ticket

  • Ronald de Gunst

    Ronald de Gunst May 8th, 2009 @ 09:33 PM

    Invalid ticket

    :attributes is no attribute of :models, :attributes is a attribute of :activerecord

    With the right translations definition all is ok.

    I18n.backend.store_translations :pt, :activerecord => {

    :models => {:person => 'Pessoa'},
    :attributes => {:person => {:name => 'Nome'}}
    
    

    }

  • Lucas de Castro

    Lucas de Castro May 8th, 2009 @ 10:02 PM

    Ronald de Gunst, you're right.

    I am sorry.

  • david001

    david001 August 9th, 2019 @ 03:32 PM

    thanks its works i almost Visit lots of websites to find the best Solution.

  • WaduRsik

    WaduRsik March 9th, 2020 @ 03:53 PM

    Now, the reform of the use is differently followed by the team. Skills of the turns and 123 help me invited for the struggle. Improvement of joy is flicked for all humans. The intensity is done for humans. Petal is formal for the mid of the means. The source is ensured for the mid of the paths for humans.

  • pbawerawi

    pbawerawi May 15th, 2020 @ 10:21 AM

    Det er mange joggere på markedet som aldri har eksperimentert med air force 1 sko https://www.jonaskotilbud.com/ Floatride-minneoppskum.

  • pbawerawi

    pbawerawi May 18th, 2020 @ 03:21 PM

    Itse voisin Jordan 4 Retro kengät https://www.klaudokengat.com/ mennä pois käyttämällä pyöräilyä 100 kk: n urheilukenkäpukuihin pukeutuneena melko kapeisiin sukkaihin, tosin tunteessani lopulta osittain tyyppiäsi, tunsin todella, että nämä tassut ovat yhtyneitä ns. varvaslaatikkosi.

  • pbawerawi

    pbawerawi May 19th, 2020 @ 02:28 PM

    Type geassocieerd is eigenlijk hoe de kosten eigenlijk nuttig zijn voor individuen die misschien niet of helemaal niet willen wijden aan het verkrijgen van een pad-schoen. Voor alleen Asics Mexico 66 GDX schoenen https://www.cusokasports.com/ van één Benjamin ontvang je hier best veel.

  • pbawerawi

    pbawerawi May 21st, 2020 @ 04:26 AM

    Ügyeljen arra, hogy vásároljon egy utazási Nike Zoom Winflo 6 cipő https://www.slezokacipo.com/ zseblámpát, amikor indul, ha nem földrajzi földrajzi helyzetben van (senki nem részesíti előnyben a kicsapodott bokáját), valamint néhány adatkompressziós lábbelit, amellyel elindulhat, valamint platformlapokat, amelyek megakadályozzák a valódi melegítést.

  • Charles Hoover

    Charles Hoover November 7th, 2020 @ 03:55 PM

    For one thing, we need to clarify that neither the mercury mastercard login nor Visa organization gives any of the cards made in their names. All things being equal, these cards are techniques for installment, with the banks in numerous nations giving the Mastercards that utilization said installment strategies.

  • dudlee

    dudlee March 2nd, 2021 @ 07:51 AM

    Online surveys are very popular at present. Most of the people are interested to take part in the surveys. On account of McDonald’s survey, clients can inform what they think about McDonald’s services. The McDVoice mainly aims at knowing the feeling of its customers when they have visited one of the stores or restaurants of McDonald's. https://mcdvoice.win

  • slotxo

    slotxo May 30th, 2021 @ 09:26 AM

    pg สล็อตเป็นเกม โปร pg ที่ใครก็สามารถ สมัคร pg เข้ามาหาความสนุก PG SLOT และเพลิดเพลินกับบริการสุดประทับใจได้ ทดลองเล่น pg 24 ชั่วโมง เทคนิคสล็อต ยิ่งในปัจจุบัน สล็อต PG ที่การเข้าถึงอินเตอร์เน็ต

  • slotxo

    slotxo June 3rd, 2021 @ 12:34 PM

    xo สล็อตออนไลน์เกม โปรสล็อต XO ที่ทำออกมาให้ความสนุก สมัคร xo และผ่อนคลายแรงกระแทกต่าง ๆ SLOTXO ที่ผู้เล่นเจอมาเท่านั้น แต่เคยสงสัยไหมว่า ทดลองเล่น xo ทำไมพอได้เข้ามาลองเล่นเกมนี้แล้ว xopg.net/ ส่วนใหญ่จะหยุดเล่นไม่ค่อยได้ นั่นก็เป็นเพราะว่าเกมนี้ มันมีดี

  • slotxo

    slotxo June 17th, 2021 @ 12:21 PM

    northbristol นั้นเป็นการใช้ทุนน้อยมาก mavoixtavoie แต่ต้องมีความใจเย็น herbalpertpresents และความอดทน reeffutures2018 ก่อนเป็นอันดับแรก เพราะว่าถ้าหากใจร้อนนั้นอาจจะหมดไวก็ได้ xopg.net/ เพราะทุนน้อย essentialsforasoul จึงต้องเล่นอย่างมีสติดีที่สุด เพราะหากเล่นแบบไม่มีสตินั้น ท่านก็จะหมดไว มาเริ่มกันเลยกับวิธีการเล่นนี้ gclub คุณต้องตั้งเป้าหมายให้ทุกครั้งก่อนที่ท่านจะเริ่มเล่น

  • slotxo

    slotxo June 18th, 2021 @ 12:26 PM

    northbristol เป็นเรื่องง่าย mavoixtavoie การเล่น herbalpertpresents ยิ่งทำได้สะดวกมากขึ้น reeffutures2018 เพราะแบบนี้จึงมีคำกล่าวที่ว่าในหมู่นักเดิมพัน xopg.net/ เนื่องจากเกม essentialsforasoul.com นี้มันสามารถเล่นผ่านหลายแพลตฟอร์มได้ ดังนั้น มันจึงตอบโจทย์ผู้เล่น และได้รับความสนใจมากเป็นพิเศษ gclub แต่นอกจากเรื่องการเข้าถึงง่ายแล้วยังมีข้อดีต่าง ๆ อีกมากมาย

  • slotxo

    slotxo June 23rd, 2021 @ 01:26 PM

    joker gaming รวมกับการวางแผนการเงินในการ joker โปร ลงเดิมพันของนัก สมัคร joker เดิมพันด้วย หากจะลอง เทคนิคสล็อต สังเกตในสล็อตออนไลน์ slot joker จะเห็นได้ว่าเมื่อ

  • slotxo

    slotxo June 24th, 2021 @ 02:11 PM

    joker gaming รวมกับการวางแผนการเงินในการ joker โปร ลงเดิมพันของนัก สมัคร joker เดิมพันด้วย หากจะลอง เทคนิคสล็อต สังเกตในสล็อตออนไลน์ slot joker จะเห็นได้ว่าเมื่อ

  • slotxo

    slotxo June 29th, 2021 @ 11:09 AM

    เทคนิคสล็อต มากกว่าที่เราเห็น สล็อต xo หรือเคยได้ยินมายังไงล่ะ northbristol ซึ่งต้องเป็นคนที่เข้ามาเดิมพัน mavoixtavoie เท่านั้น herbalpertpresents ถึงจะทราบในข้อดีส่วนนี้ reeffutures2018 ความจริงแล้วสล็อต gclub ออนไลน์เป็นเกมที่ต้องอาศัยการคำนวณเข้าามาช่วยนิดหน่อย

  • slotxo

    slotxo June 30th, 2021 @ 11:43 AM

    AMBBET เมื่อเราเล่นเกมสล็อตชนะ ambbet โปร หรือได้โบนัสตามเงื่อนไข AMB ของคาสิโนออนไลน์ สมัคร amb บอกเลยว่า บาคาร่า เงินทุกบาทที่ได้จากการ เกมสล็อต เล่น เว็บคาสิโน สามารถเอาออกมาใช้ได้จริง เกมคาสิโน สำหรับการเล่นนี้

  • iloveyou2

    iloveyou2 June 28th, 2023 @ 05:25 PM

    pgslot1234 Online slots Gambling or casino games in online form, it must be said that one of the hottest games is irrefutable to the popular cabinet games like PG slots.

  • iloveyou2

    iloveyou2 June 28th, 2023 @ 05:26 PM

    PGSlot 444 can be played directly through their website. WHICH YOU NEED TO MAKE A REGISTRATION FIRST TO ACCESS THE SERVICES PG SLOT AVAILABLE ON THE WEBSITE.

  • oilumiun12

    oilumiun12 February 17th, 2024 @ 03:40 AM

    fnaf boasts a unique and innovative gameplay mechanic that will test your nerves like no other. With limited power to control lights and doors, each decision you make has dire consequences. Will you conserve energy and risk being ambushed, or will you panic and waste precious resources?

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

Repository for collecting Locale data for Ruby on Rails I18n as well as other interesting, Rails related I18n stuff

People watching this ticket

Pages