-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Resource names are not being translated properly on notice messages #1242
Comments
I've worked around this by overriding the def translate_with_resource(key)
t(
"administrate.controller.#{key}",
resource: resource_class.model_name.human
)
end But I still think that this should come by default |
betelgeuse
added a commit
to betelgeuse/administrate
that referenced
this issue
Apr 28, 2020
betelgeuse
added a commit
to betelgeuse/administrate
that referenced
this issue
Apr 28, 2020
betelgeuse
added a commit
to betelgeuse/administrate
that referenced
this issue
Apr 28, 2020
betelgeuse
added a commit
to betelgeuse/administrate
that referenced
this issue
Apr 28, 2020
betelgeuse
added a commit
to betelgeuse/administrate
that referenced
this issue
Apr 28, 2020
betelgeuse
added a commit
to betelgeuse/administrate
that referenced
this issue
Apr 28, 2020
nickcharlton
pushed a commit
to betelgeuse/administrate
that referenced
this issue
Oct 6, 2020
nickcharlton
pushed a commit
that referenced
this issue
Oct 6, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The resource model name isn't being translated when you execute a DB transaction (create, for example). The whole message is translated according to the
yml
file but the resource model name.I believe the problem relies on
ResourceReolver#resource_title
, which just parses the current path and returns ajoined
string. The#translate_with_resource
(the method that translated the message itself) should useResourceReolver#resource_class
combined with ActiveRecord locale methods to return the resource model name already localized to the message translator methodThis is the message that I'm getting

And my
yml
file does have that model translation entryThis problem is happening with other resources around my admin section
The text was updated successfully, but these errors were encountered: