But this seems nasty like i say, and also assumes that in all languages
there will be three text chunks with the size in between, which might
not be the case. Can i somehow incorporate variables into my locale.yml
files? or some other similar approach?
…
wrong_question_number:
one: “Must have #{count} question”
other: “Must have #{count} questions”
Thanks Henrik. So you can pass variables into the .yml file
then? (tries it…)
Hmm, i just get the string without the interpolation: eg, trying it with
a simple example, just called from the view template rather than a model
validation:
Surely it wouldn’t make any difference anyway? The string interpolation
would happen before the t method is called, right? So it would just be
like passing a string through. And if it can take integers dynamically
then surely it can take strings dynamically. Seems my problem is that
it’s not taking anything dynamically.
� � �description: “Description for your {{size}} question quiz”
Oops, yeah, I should have added an “off the top of my head” Stupid
mistake on my part. Glad you got it working!
No worries, cheers
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.