My app's pricing plan has some features that are unlimited. For example in the "Pro" version you get 10 forms, and in the "Unlimited" version you get unlimited forms.
This is represented in the Plan model by an integer or Float::Infinity.
pro = Plan.find_by name: 'Pro'
pro.forms_limit
#=> 10
unl = Plan.find_by name: 'Unlimited'
unl.forms_limit
#=> Float::INFINITY
In the view:
= t('.forms', count: plan.forms_limit)
I am trying to find an efficient way to interpolate this with I18n. What I'd like to do is:
plans:
index:
forms:
zero: No Forms
one: 1 Form
other: "%{count} Forms"
infinity: Unlimited Forms
This will work, but it results in undesired output like:
"Infinity Forms"
Is there a way to structure this so that Infinity will interpolate "Unlimited" instead of "Infinity"?