diff --git a/lib/i18n/tasks/plural_keys.rb b/lib/i18n/tasks/plural_keys.rb index 68ab523d..bd310fae 100644 --- a/lib/i18n/tasks/plural_keys.rb +++ b/lib/i18n/tasks/plural_keys.rb @@ -46,9 +46,14 @@ def plural_nodes(tree) end def plural_forms?(s) + return false if non_plural_other?(s) s.present? && s.all? { |node| node.leaf? && plural_suffix?(node.key) } end + def non_plural_other?(s) + s.size == 1 && s.first.leaf? && (!s.first.value.is_a?(String) || !s.first.value.include?('%{count}')) + end + def plural_suffix?(key) PLURAL_KEY_SUFFIXES.include?(key) end