I noticed that there was no textdomain field in the block.json generated by the acf:cache command.
This field is required to translate the block title and description.
Below is what I've set up to add the field if you'd like to test.
namespace App\Blocks;
use Log1x\AcfComposer\Block;
use Log1x\AcfComposer\AcfComposer;
use Illuminate\Support\Collection;
class MyBlock extends Block
{
public string $textdomain = 'theme-domain';
public function __construct(AcfComposer $composer)
{
parent::__construct($composer);
$this->name = _x('My Block Title', 'block title', 'theme-domain');
$this->description = _x('My Block Description', 'block description', 'theme-domain');
}
public function settings(): Collection
{
return parent::settings()->put('textdomain', $this->textdomain);
}
}
Hello,
I noticed that there was no
textdomain
field in theblock.json
generated by theacf:cache
command. This field is required to translate the block title and description. Below is what I've set up to add the field if you'd like to test.