lib/i18n/assets/sprockets.rb in i18n-assets-0.0.6 vs lib/i18n/assets/sprockets.rb in i18n-assets-0.0.7
- old
+ new
@@ -48,11 +48,11 @@
manifest[aliased_path_for(asset.logical_path)] = digest_path
end
end
if Sprockets.localizable?(logical_path)
- I18n.available_locales.each do |locale|
+ (Rails.configuration.assets.locales || I18n.available_locales).each do |locale|
I18n.locale = locale
process.call
end
else
process.call
@@ -107,10 +107,10 @@
private
def extract_locale(path)
locale = path[/^\/([a-z\-_]+?)\//, 1]
- if I18n.available_locales.map(&:to_s).include? locale
+ if (Rails.configuration.assets.locales || I18n.available_locales).map(&:to_s).include? locale
locale
else
nil
end
end