CRUD
CRUD copied to clipboard
wip: setup crud fields based on update language
Notice that all the strings inside the fields html will get translated.
A new inspection was created.


Notice that all the strings inside the fields html will get translated.
That's a good thing, right? 😅 I think it's the expected behaviour.
Notice that all the strings inside the fields html will get translated.
That's a good thing, right? 😅 I think it's the expected behaviour.
I am not sure if the intent is to translate the whole field html (notice that you are not switching admin panel language, you are editing an entry in other language).
- Some people might want to keep things as is.
- Some people might want to translate the whole editing page. (like this PR)
- Some people might want only the related results in the editing language
Notice that all the strings inside the fields html will get translated.
Reminder Pedro: we talked about this, and now that we think about it it is NOT the expected behaviour 🤣
So maybe we do something like this, inside each select (non-ajax) field?!
$field['getOptionAttribute'] = $field['getOptionAttribute'] ? call_user_func($field['getOptionAttribute']) : (function ($option, $attribute) {
// if model is translatable and config says we should show that,
return $option->getTranslation($attribute, $lang);
// else
return $option->$attribute;
});
Food for thought...
Closing this as we have other more recent PR's that aim to fix this. #4267