Skip to content

Commit

Permalink
rescue for NaN in asset_translations
Browse files Browse the repository at this point in the history
  • Loading branch information
Dylan Stamat committed Oct 6, 2009
1 parent b7983cf commit 9d115e8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/controllers/translations_controller.rb
Expand Up @@ -40,7 +40,7 @@ def asset_translations

@asset_translations = I18n.asset_translations
@untranslated_assets = I18n.untranslated_assets(@locale.code)
@percentage_translated = ( (@asset_translations.size - @untranslated_assets.size).to_f / @asset_translations.size.to_f * 100).round
@percentage_translated = (((@asset_translations.size - @untranslated_assets.size).to_f / @asset_translations.size.to_f * 100).round) rescue 0

if @translation_option == TranslationOption.translated
@asset_translations = @asset_translations.reject{|e| @untranslated_assets.include?(e)}
Expand Down

0 comments on commit 9d115e8

Please sign in to comment.