Multilingual: Publish in multiple languages


I'm looking for a way for page editors to publish a page in multiple languages straight away.
The optimal solution would be checkboxes for all site languages, and when checked the page is published to all of those. Translation is not important at this stage.

Would this be possible using a custom attribute perhaps?

I guess I want to call "create_new" on publish?


View Replies:
skorge replied on at Permalink Reply

I guess I want to do something similar to what the Multilingual Blog extension does, but default all content to the same language.
skorge replied on at Permalink Reply
I think I am on my way to find a solution to my problem. However I am a bit stuck at the end of it.

My idea is to listen for the page publish event, and then look at the page type and custom attributes for additional languages to publish in. The code below from /application/bootstrap/app.php passes trough without any errors, but it seems to just add a new version draft for the original locale instead of setting up a new page in the target locale.

Can anyone give me any hints what to look at?

Events::addListener('on_page_type_publish', function($event) {
    $page = $event->getPageObject();
    if ($page->getPageTypeHandle() == 'blog_entry') {
        $multilingualController = Core::make('\Concrete\Controller\Backend\Page\Multilingual');
        $pageCollection = $page->getCollectionID();
        $pageSection = \Concrete\Core\Multilingual\Page\Section\Section::getBySectionOfSite($page);
        $pageLocaleText = $pageSection->getLanguageText();
        $targetLocale = \Concrete\Core\Multilingual\Page\Section\Section::getByLocale('nb_NO'); //Will be set from page attribute
        $targetLocaleCollection = $targetLocale->getCollectionID();
        $createNewData = array(
        'section' => $targetLocaleCollection,
        'cID' => $pageCollection