Open novelnet opened 2 years ago
Can be easily solved by translating {{ __(field.button) }}
in <default-button />
of SearchMenu.vue and OriginalDropMenu.vue, instead of the Field Constructor (before the translations are loaded yet). I can provide a pull request
I'd make a pull request if possible, at least then the maintainers can just review and merge when they can.
Any progress? Kind of critical from end user view, as this component breaks even outside in Nova translations..
I can see how my colloquial phrasing of my response would suggest I was going to make the pull request, I was suggesting you do it as you said in your earlier comment, apologies!
Yes, i misunderstood that. In the meantime i ended up in overriding the constructor for myself, removing the translation function and using custom labeling:
class FlexibleOverride extends Flexible {
public function __construct($name, $attribute = null, $resolveCallback = null)
{
\Laravel\Nova\Fields\Field::__construct($name, $attribute, $resolveCallback);
#https://github.com/whitecube/nova-flexible-content/issues/350
$this->button('Add layout');
// The original menu as default
$this->menu('flexible-drop-menu');
$this->hideFromIndex();
}
}
May dig deeper in looking for a better solution to commit, when i have some time off.
Thanks for investigating this. Would definitely appreciate a PR with a fix. 👍
I have set the locale to 'de'. When using nova-flexbile-content anywhere in Nova the translations break in some places only, like here:
When i remove the translation function
__('Add layout')
in Flexible.php everything works in Nova again:This issue has multiple users probably and there is also one open at Nova directly: laravel/nova-issues#4192
Thanks in advance.