You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adding the scope will add the name_translated and slug_translated fields, but it's a bit weird to have to deal with that on the front end. I tried to name the columns in the scope name and slug (i.e. as `{$column}`), but that results in them having a value of null when requesting the resource, no idea why 😕
This discussion was converted from issue #331 on June 07, 2021 06:49.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Kind of related to #198, I'm looking for a way to fetch all tags already translated.
Basically, I'm currently trying to get and show the list of tags for an API call:
But this gives me the
name
andslug
fields as objects with ALL translations, instead of the locale translated value itself.At the moment the only solution I've come up with is to create a custom scope on my
Tag
model, like this:Adding the scope will add the
name_translated
andslug_translated
fields, but it's a bit weird to have to deal with that on the front end. I tried to name the columns in the scopename
andslug
(i.e.as `{$column}`
), but that results in them having a value ofnull
when requesting the resource, no idea why 😕How do I do this?
Beta Was this translation helpful? Give feedback.
All reactions