crp87 - hey guys 🙂Have another question. It's...
# ❓questions
c
hey guys 🙂 Have another question. It's about translations. I can do:
$item->translations->first()->meta_title
but:
$item->meta_title
dose not work. But seems like an overkill to execute an additional SQL for every required translation. Accessing them through getTranslationsArray() seems also not nice because i have to put some logic inside the view. The package>capsule>model is generated with HasTranslations support and they also work properly on twill admin interface but when I try to access them individually on the page model ($item), they won't work. I can see the translations being loaded when dumping the $item with dd(). Did I just miss something?
i
direct access to translated fields should work without accessing the translations
is meta_title in your model's translatedAttributes?
c
hi @ifox yes, it is in translatedAttributes but calling it directly returns null 😭

https://cdn.discordapp.com/attachments/1107544427888644177/1107721808087629925/Bildschirmfoto_2023-05-15_um_19.30.49.png

i
that's weird. Did you change anything in the translatable.php config file?
c
oh, wait, i need to set use_fallback to true, then it works.. thats weird because it works for all locales now - no matter if translation is available or not (then fallback gets used) but with use_fallback set to false, event the existing translations are not being displayed
i
🤔 dang that's interesting
any chance you could provide a reproduction?
c
uh, for that i need to check what is really causing it - i keep that in my list and as soon as i find some time, i'll create a ticket and attache the reproduction code