lib/Core/Service/BlockService.php
private function internalDisableTranslations(PersistenceBlock $block): PersistenceBlock
    {
        $block = $this->blockHandler->updateBlock(
            $block,
            BlockUpdateStruct::fromArray(
                [
                    'isTranslatable' => false,
                ]
            )
        );

        foreach ($block->availableLocales as $locale) {
            if ($locale !== $block->mainLocale) {
                $block = $this->blockHandler->deleteBlockTranslation(
                    $block,
                    $locale
                );
            }
        }

        foreach ($this->blockHandler->loadChildBlocks($block) as $childBlock) {
            $this->internalDisableTranslations($childBlock);
        }

        return $block;
    }
private function internalDisableTranslations(PersistenceBlock $block): PersistenceBlock
    {
        $block = $this->blockHandler->updateBlock(
            $block,
            BlockUpdateStruct::fromArray(
                [
                    'isTranslatable' => false,
                ]
            )
        );

        foreach ($block->availableLocales as $locale) {
            if ($locale !== $block->mainLocale) {
                $block = $this->blockHandler->deleteBlockTranslation(
                    $block,
                    $locale
                );
            }
        }

        foreach ($this->blockHandler->loadChildBlocks($block) as $childBlock) {
            $this->internalDisableTranslations($childBlock);
        }

        return $block;
    }
private function internalDisableTranslations ( PersistenceBlock $ block ) : PersistenceBlock { $ block = $ this -> blockHandler -> updateBlock ( $ block , BlockUpdateStruct :: fromArray ( [ 'isTranslatable' => false , ] ) ) ; foreach ( $ block -> availableLocales as $ locale ) { if ( $ locale !== $ block -> mainLocale ) { $ block = $ this -> blockHandler -> deleteBlockTranslation ( $ block , $ locale ) ; } } foreach ( $ this -> blockHandler -> loadChildBlocks ( $ block ) as $ childBlock ) { $ this -> internalDisableTranslations ( $ childBlock ) ; } return $ block ; }
Disables the translations on provided block and removes all translations
keeping only the main one.
Disables the translations on provided block and removes all translations keeping only the main one .