Duplicating Matrix fields with content from another locale
For Matrix fields, you would basically need to duplicate all of this logic (or move it to a separate function), to recreate each Matrix block.



$newBlocks = array();

foreach ($gbr-&gt;$fieldHandle-&gt;find() as $gbrBlock)
{
    $newBlock = new MatrixBlockModel();
    $newBlock-&gt;fieldId = $field-&gt;id;
    $newBlock-&gt;typeId  = $gbrBlock-&gt;getType()-&gt;id;
    $newBlock-&gt;ownerId = $element-&gt;id;
    $newBlock-&gt;locale  = $newLocale;

    $newBlockContent = $newBlock-&gt;getContent();

    foreach ($gbrBlock-&gt;getFieldLayout()-&gt;getFields() as $gbrBlockFieldLayoutField)
    {
        // same field value duplication logic...
    }

    $newBlocks[] = $newBlock;
}

$content-&gt;$fieldHandle = $newBlocks;


Unfortunately there’s just no easy way to duplicate element content at the moment. Field types each store things differently, and the way they expect their values to be formatted when saving an element may be different from how they are formatted when fetching an existing element from the DB. (This is something we’ve made much easier in Craft 3 though.)