-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
feature: Translations for Rails::Generators #1008
Comments
@digitalfrost thank you for the update cleanup on the issues. |
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. 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: |
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. |
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.
The text was updated successfully, but these errors were encountered: