I'm looking for a way to iterate on an array and falling back to site.default_lang if site.lang does not contain the translation.
The for o in site.translations[site.lang].somethings solution does work, but not if I want to fall back to default lang.
For now I came with the following solution which I don't find very elegant:
From what I've seen, the current version uses the default language as a fallback. Found this issue while trying to figure out how to not have that behavior.
Hi!
First, thanks a lot for this very useful gem.
I'm looking for a way to iterate on an array and falling back to
site.default_lang
ifsite.lang
does not contain the translation. Thefor o in site.translations[site.lang].somethings
solution does work, but not if I want to fall back to default lang.For now I came with the following solution which I don't find very elegant:
Is there a simpler way to achieve this that I did not think about? If not, is this something you would be interesting in supporting?
Thanks again, Hugo