views:

17

answers:

0

I would like to return a string from a model, which can be used directly in the liquid-based template. The problem is, that I would like the string to be translated using gettext.

I cannot use _("string") right into model.to_liquid, because it doesn't work. As far as I understand, the model is loaded once, and it will always return the same translation for the given string. Translation should be done later on the controller/view layer, but in this case its not really possible. The model is passed directly via liquid to the end user.

Do you have any suggestion how to solve this problem?