示例#1
0
 private function merge(\Gettext_Translations $current, Translatable $parent, $locale)
 {
     $parent_loader = $parent->loadExisting($locale);
     $comment = "Copied from {$parent->id}/{$locale}";
     foreach ($current->entries as $entry_id => &$entry) {
         if (isset($parent_loader->entries[$entry_id]) && (empty($entry->translations) || $entry->translator_comments == $comment)) {
             if ($translations = $parent_loader->entries[$entry_id]->translations) {
                 $entry->translator_comments = $comment;
                 $entry->translations = $translations;
             }
         }
     }
 }