1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
Commit graph

24 commits

Author SHA1 Message Date
Francesco Rodriguez
c9a88a2c26 minor edits in AM documentation [ci skip] 2012-10-21 01:26:01 -05:00
Tsutomu Kuroda
b0e2fc843b Fix human attribute_name to handle deeply nested attributes
When a model nests another model that also nests yet another model
using accepts_nested_attributes_for method, its Errors object can
have an attribute name with "contacts.addresses.street" style.

In this case, the dots within the namespace should be substituted
with slashes so that we can provide the translation under the
"activemodel.attributes.person/contacts/addresses.street" key.

This commit is related to #3859.
2012-05-16 08:39:48 +09:00
Carlos Antonio da Silva
f48d83b599 Refactor human attribute name 2012-04-28 12:14:59 -03:00
Carlos Antonio da Silva
cafe6a38f5 Do not modify options hash in human_attribute_name, remove reverse_merge 2012-04-28 11:23:29 -03:00
José Valim
d4964b3386 Namespaced attribute lookup now works as 'model/association.attribute'. 2011-12-05 15:39:41 +01:00
Tsutomu Kuroda
dff19f7be2 Fix human_attribute_name to handle names with dots
Nested I18n namespace lookup under activerecord.models is deprecated now (c19bd4f).
But when a model uses accepts_nested_attributes_for, its Errors object can have
an attribute name with "addresses.street" style. In this case, the dots should be
substituted with slashes so that we can provide the translation under the
"activemodel.attributes.person.addresses/street" key.
2011-12-05 22:57:47 +09:00
José Valim
410a42860b Get rid of the alternate namespace lookup. 2011-06-11 18:01:26 +02:00
thoefer
0831b7e076 Brought back alternative convention for namespaced models in i18n. 2011-06-08 13:40:17 +02:00
Sebastian Martinez
a2bfa5fa30 Better formatting on ActiveModel::Translation 2011-04-26 23:26:10 -03:00
Santiago Pastorino
4f90b28e06 Bring back AMo#i18n_key method 2011-03-30 16:29:43 -03:00
Santiago Pastorino
a00bed0c48 Revert "Properly interpolate i18n keys in modules [#5572 state:resolved]"
This breaks #6448, you should use :"module/class" as key for namespacing
[#6448 state:committed]

This reverts commit 8d30193b08.
2011-02-27 21:30:03 -02:00
Rodrigo Rosenfeld Rosas
8d30193b08 Properly interpolate i18n keys in modules [#5572 state:resolved] 2010-09-24 20:41:12 +02:00
José Valim
f0ee4a6002 Remove deprecations in ActiveModel. 2010-08-29 20:45:34 -03:00
Santiago Pastorino
b451de0d6d Deletes trailing whitespaces (over text files only find * -type f -exec sed 's/[ \t]*$//' -i {} \;) 2010-08-14 04:12:33 -03:00
Xavier Noria
755af49755 edit pass to apply API guideline wrt the use of "# =>" in example code 2010-07-30 02:30:04 +02:00
Evgeniy Dolzhenko
ef404c771d Fix a bunch of minor spelling mistakes 2010-06-15 12:04:22 +04:00
Rizwan Reza
7d7d54fa1f Revised the rest of the files from ActiveModel. 2010-06-14 13:56:51 +04:30
Evgeniy Dolzhenko
ccf9577aee Fix a bunch of minor spelling mistakes 2010-06-11 14:15:34 +04:00
Mikel Lindsaar
91c38403be Adding documentation for ActiveModel::Translation 2010-01-18 18:13:49 +11:00
José Valim
a25ef06956 Allow to specify default attributes names translation in I18n yml files.
For example, you could easily specify :created_at and :updated_at translations as:

  en:
    attributes:
      created_at: "Created at"
      updated_at: "Updated at"

This configuration is built on ActiveModel, so it means those translations are
shared between different ORMs as well (but always as a fallback).
2010-01-07 15:31:50 +01:00
José Valim
e31077c9aa Small clean up in Naming and TTranslation tests. 2009-12-23 12:28:02 +01:00
Jeremy Kemper
3fd2624be4 Uses Hash#reverse_merge 2009-11-13 10:31:05 -08:00
José Valim
9fbb2c571b Fix error_messages_for when instance variable names are given.
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2009-10-21 11:18:36 -05:00
José Valim
e714b499cc Move validator, human_name and human_attribute_name to ActiveModel, remove deprecated error messages and add i18n_scope and lookup_ancestors.
Signed-off-by: Carl Lerche <carllerche@mac.com>
2009-10-20 17:52:32 -07:00