Skip to content
This repository

Alternative I18n convention for namespaced models is not supported in Rails 3.1 #1402

Closed
paneq opened this Issue · 16 comments

6 participants

Robert Pankowecki Aaron Patterson Santiago Pastorino Prem Sichanugrist José Valim Thomas Höfer
Robert Pankowecki
paneq commented

During Rails 3.0.6 release it was decided that 2 conventions for storing translations for namespaced models should be supported. The alternative convention was added. It is not supported anymore in Rails 3.1.0.rc1 currently.

http://groups.google.com/group/rubyonrails-core/browse_thread/thread/eca57305b1a3ea0d

Also. The convention was not fully established for Rails 3.0.* . It could be used for
Namespaced::Model.model_name.human
Namespaced::Model.human_attribute_name
but not for
Namespaced::Model.new.errors.add(...)

I think we should keep and expand the support for alternative translation convention that uses dots instead of slashes.

Prem Sichanugrist
Collaborator
sikachu commented

@tenderlove do you mind looking into this one?

Prem Sichanugrist
Collaborator

Part of it has been merged in to master and 3-1-stable. Do you mind making a pull request for that?

Prem Sichanugrist
Collaborator

Forgot to refer to this pull request: #1556

Robert Pankowecki
paneq commented

So what about Namespaced::Model.new.errors.add ? I can provide patch for that for rails 3.0.* and rails 3.1.* during the weekend. Would you merge it ?

Thomas Höfer

@paneq: Of course, provide a patch. I´m sure sikachu will merge if you solve the problem.

Prem Sichanugrist
Collaborator

@paneq yep, send 'em in. ;)

Santiago Pastorino
Owner

If I'm not wrong this was fixed in #1556, if it's still an issue please add a comment and I will reopen it.

Santiago Pastorino spastorino closed this
Prem Sichanugrist sikachu reopened this
Thomas Höfer

@spastorino
Just for clarification: Currently you cannot use both conventions for "Namespaced::Model.new.errors.add(...)" (as per paneq´s issue description, I´ve not tested this) which may confuse users. I think paneq works on it over the weekend. The original problem with either support for one or the other convention from ealier rails versions (3.0.x) is solved by supporting both. This is what pull request 1556 did.

Thomas Höfer thoefer referenced this issue from a commit
thoefer2 Implemented support for usage of alternative conventions for namespac…
…ed models in error messages. This solves issue #1402 completely.
c28af50
Thomas Höfer

Sorry @paneq I couldn´t resist ;) Any comments on this implementation?

Thomas Höfer

If it´s good enough I will provide a backport for 3.1-stable. I established an external .yal-file for testing namespaced translations, too. I hope this is ok.

Thomas Höfer

@paneq @sikachu
Just to let you know: Looks like the namespaced model feature will be removed completely...

Robert Pankowecki
paneq commented

@thoefer - What are you talking about? Who told you that? I highly doubt that I won't be possible to use namespaced models in Rails. That wouldn't make any sense.

Robert Pankowecki
paneq commented

Be precise next time please :-) Jose comment in the pull request is about translations of namespaced models errors. Not about namespaced models per se

Thomas Höfer

The way I understand it is that he want to remove the support for "[...]nested namespaced setting[...]". I think he refers to the entire possibility of nesting and using "dot-syntax".

José Valim
Owner

Yes, nested I18n lookup was removed.

José Valim josevalim closed this
Bryan Mahoney bryanmtl referenced this issue from a commit in bryanmtl/g-refinerycms
Jamie Winsor Fix for [DEPRECATION WARNING] Nested I18n namespace lookup under "act…
…iverecord.attributes.refinery" is no longer supported

Fix for [DEPRECATION WARNING] Nested I18n namespace lookup under "activerecord.models.refinery" is no longer supported

See rails ticket rails/rails#1402 for details
f55c48c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.