rails-i18n
rails-i18n copied to clipboard
feature: Translations for Rails::Generators
Translations for Rails generators and scaffolding would seem to fit in the scope of rails-i18n, but seem to be only partially included. For example in the
controller template:
notice: <%= %("#{human_name} was successfully created.") %>
or in new
<%%= link_to "Back to <%= human_name.pluralize.downcase %>", <%= index_helper(type: :path) %> %>
Oddly, it looks like there are currently translations for errors within the templates at errors.template.header for some template strings, but not success, back, or destroy. How about adding a section for template.errors.* and template.messages.* to handle these cases?
This is similar to issue #784 but generalizes it.
@jpgeek thank you - this ticket is a lot clearer than #784
@digitalfrost thank you for the update cleanup on the issues. If this is something that you and the other maintainers feel is in-scope, I would be happy to suggest a scope, put in a PR and provide translations for en and ja. If it is out of scope I will extract the scaffold translations into another gem and we can close this feature.
@kuroda and @pama - Could you please give feedback. To me this seems like a good idea.
I have some concerns.
First, it should be optional to avoid breaking existing code/workflow, and #1019 could be a starting point to accomplish that.
Second, it concerns me that by introducing this change, we will also need to maintain the scaffold code, which seems somehow out of scope.
Thanks @pama.
So using #1019 we could put the scaffold translations under rails/scaffold. That makes sense.
As to your second point, wouldn't the scaffold code still be the responsibility of the scaffold (railties) team, just like it is for say ActiveRecord? For example with Active Record, the I18n scope is determined in the Rails code: here If we can get the scaffold (railties) team to come up with the namespace (or we suggest one) would that work?
I would prefer to view the scaffold code in the Ruby on Rails source, allowing us to provide translations through rails-i18n.
I am not inclined to maintain a separate scaffold branch in this gem. I recommend initiating a discussion on https://discuss.rubyonrails.org/c/rubyonrails-core/5.
Thank you @pama . I opened a discussion there last year: here No replies yet. Does not look like it will happen there either.