Sha256: 6fb9b9b4f266532e749ab79cfa8cfaf8f78651a607529481687f5dc903762d2d
Contents?: true
Size: 541 Bytes
Versions: 6
Compression:
Stored size: 541 Bytes
Contents
module Vulgata module AdminHelper def locale_progress_percentage locale if TranslationState.any? approved_for_locale = TranslationState.where(locale: locale).where(status: Vulgata::TranslationState.statuses[:approved]).count.to_f sources_of_other_locales = TranslationState.where.not(locale: locale).where(status: Vulgata::TranslationState.statuses[:source]).count.to_f return sources_of_other_locales == 0 ? 100 : (approved_for_locale / sources_of_other_locales * 100).floor end end end end
Version data entries
6 entries across 6 versions & 1 rubygems