loadTranslation example

$translate_path = $node->toUrl('drupal:content-translation-overview');

    // Create a new English draft (revision 2).     $this->drupalGet($edit_path);
    $this->submitNodeForm('Test 1.2 EN', 'draft', TRUE);
    $this->assertLatestVersionPage($node);

    // Add a French translation draft (revision 3).     $this->drupalGet($translate_path);
    $this->clickLink('Add');
    $this->submitNodeForm('Test 1.3 FR', 'draft');
    $fr_node = $this->loadTranslation($node, 'fr');
    $this->assertLatestVersionPage($fr_node);
    $this->assertModerationForm($node);

    // Add an Italian translation draft (revision 4).     $this->drupalGet($translate_path);
    $this->clickLink('Add');
    $this->submitNodeForm('Test 1.4 IT', 'draft');
    $it_node = $this->loadTranslation($node, 'it');
    $this->assertLatestVersionPage($it_node);
    $this->assertModerationForm($node);
    $this->assertModerationForm($fr_node);

    
Home | Imprint | This part of the site doesn't use cookies.