lib/i18n/tasks/scanners/relative_keys.rb in i18n-tasks-0.7.12 vs lib/i18n/tasks/scanners/relative_keys.rb in i18n-tasks-0.7.13
- old
+ new
@@ -40,10 +40,11 @@
def prefix(normalized_path, roots, options = {})
file_name = normalized_path.gsub(%r(#{path_root(normalized_path, roots)}/|(\.[^/]+)*$), '')
if options[:closest_method].present?
- "#{file_name.split('_').first}.#{options[:closest_method]}".tr('/', '.')
+ controller_name = file_name.sub(/_controller$/, '')
+ "#{controller_name}.#{options[:closest_method]}".tr('/', '.')
else
file_name.tr('/', '.').gsub(%r(\._), '.')
end
end
end