19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
# File 'lib/rails_i18n_routes/action_dispatch/mapper.rb', line 19
def add_route(action, options)
if @locales
@locales.each do |locale|
path = @scope[:path].dup if @scope[:path].present?
path_names = @scope[:path_names].dup
@scope[:path] = i18n_path(path, locale) if @scope[:path].present?
@scope[:path_names].each { |key, value| @scope[:path_names][key] = I18n.t("routes.#{key}", :locale => locale, :default => value) }
super(*[i18n_path(action, locale), i18n_options(options, locale)])
@scope[:path] = path if @scope[:path].present?
@scope[:path_names] = path_names
end
@set.named_routes.define_i18n_route_helper @scope[:as] ? "#{@scope[:as]}_#{options[:as]}" : options[:as] unless @scope[:scope_level_resource].present?
return
end
super
end
|