Merge the translations of two translations.

@param Translation $from
@param Translation $to
@param int         $options
328365
public static function mergeTranslation(Translation $from, Translation $to, $options = self::DEFAULTS)
    {
        $override = (boolean) ($options & self::TRANSLATION_OVERRIDE);

        if (!$to->hasTranslation() || ($from->hasTranslation() && $override)) {
            $to->setTranslation($from->getTranslation());
        }

        if (!$to->hasPlural() || ($from->hasPlural() && $override)) {
            $to->setPlural($from->getPlural());
        }

        if (!$to->hasPluralTranslations() || ($from->hasPluralTranslations() && $override)) {
            $to->setPluralTranslations($from->getPluralTranslations());
        }
    }
1247074
public function setPriceChange($from, $to)
    {
        $this->priceChanged = true;
        $this->priceChangeFrom = $from;
        $this->priceChangeTo = $to;
    }
356129
public function mergeWith(Translation $translation, $options = Merge::DEFAULTS)
    {
        Merge::mergeTranslation($translation, $this, $options);
        Merge::mergeReferences($translation, $this, $options);
        Merge::mergeComments($translation, $this, $options);
        Merge::mergeExtractedComments($translation, $this, $options);
        Merge::mergeFlags($translation, $this, $options);

        return $this;
    }
141710
public function rename($from, $to)
    {
        if (is_null($key = $this->search($from))) {
            return false;
        }

        $this->items[$key] = $this->getSlugFromName($to);

        return true;
    }
167468
private function copyFromTo($from, $to)
    {
        $directory = dirname($to);
        if (!is_dir($directory)) {
            mkdir($directory, 0777, true);
        }

        copy($from, $to);
    }
894198
public function sync(string $from, string $to, array $config = []): void
    {
        $this->syncPlugin->sync($this, $from, $to, $config);
    }
588858
public function merge( $from, $to, EditInfo $editInfo = null ) {
		$params = array(
			'fromid' => $this->getIdFromInput( $from ),
			'toid' => $this->getIdFromInput( $to )
		);

		$this->api->postRequest( 'wbmergeitems', $params, $editInfo );
		return true;
	}
499921
public static function mergeReferences(Translation $from, Translation $to, $options = self::DEFAULTS)
    {
        if ($options & self::REFERENCES_THEIRS) {
            $to->deleteReferences();
        }

        if (!($options & self::REFERENCES_OURS)) {
            foreach ($from->getReferences() as $reference) {
                $to->addReference($reference[0], $reference[1]);
            }
        }
    }
852165
public function migrateExpiredJobs($from, $to)
    {
        $options = ['cas' => true, 'watch' => $from, 'retry' => 10];

        $this->__handler->transaction($options, function ($transaction) use ($from, $to) {

            $queueData = $this->getExpiredJobs(
                $transaction, $from, $time = time()
            );

            if (count($queueData) > 0)
            {
                $this->removeExpiredJobs($transaction, $from, $time);

                $this->pushExpiredJobsOntoNewQueue($transaction, $to, $queueData);
            }
        });
    }
1171092
public static function mergeFlags(Translation $from, Translation $to, $options = self::DEFAULTS)
    {
        if ($options & self::FLAGS_THEIRS) {
            $to->deleteFlags();
        }

        if (!($options & self::FLAGS_OURS)) {
            foreach ($from->getFlags() as $flag) {
                $to->addFlag($flag);
            }
        }
    }
1324820
public function move( $from, $to )
	{
		try {
			$this->fs->move( $from, $to );
		} catch( \Exception $e ) {
			throw new Exception( $e->getMessage(), 0, $e );
		}
	}
937897
public function translate($string, $from, $to)
    {
        foreach ($this->translatorServices as $service) {
            try {
                return $service->translate($string, $from, $to);
            } catch (TranslatorException\NoTranslationFoundException $e) {
                // Do nothing, try again.
            } catch (TranslatorException $e) {
                $this->log('error', $e->getMessage());
            } catch (\Exception $e) {
                $this->log('alert', $e->getMessage());
            }
        }

        return;
    }
1278141
protected function setAttributes(DOMNode $from, DOMNode $to, array $options) {
		$width = isset($options['width']) ? (int)$options['width'] : 0;
		$height = isset($options['height']) ? (int)$options['height'] : 0;
		$class = isset($options['class']) ? (string)$options['class'] : '';

		$classes = explode(' ', $class . ' ' . $from->getAttribute('class'));
		$classes = array_map('trim', $classes);
		$classes = array_filter($classes);
		$classes = array_unique($classes);
		$to->setAttribute('class', implode(' ', $classes));

		if ($width || $from->hasAttribute('width')) {
			$to->setAttribute('width', $width ?: $from->getAttribute('width'));
		}
		if ($height || $from->hasAttribute('height')) {
			$to->setAttribute('height', $height ?: $from->getAttribute('height'));
		}
		if ($from->hasAttribute('viewBox')) {
			$to->setAttribute('viewBox', $from->getAttribute('viewBox'));
		}
		if ($from->hasAttribute('preserveAspectRatio')) {
			$to->setAttribute('preserveAspectRatio', $from->getAttribute('preserveAspectRatio'));
		}
	}
1364166
public function translate($word, $to, $from = null)
    {
        if (is_null($this->translator)) {
            /** @var string $translator */
            $translator       = config(self::PREFIX_LARAVEL_CONFIG.'translator');
            $this->translator = new Translator('Microsoft', [
                'client_key'       => config(self::PREFIX_LARAVEL_CONFIG.'translators.'.$translator.'.client_key'),
                'default_language' => config(self::PREFIX_LARAVEL_CONFIG.'translators.'.$translator.'.default_language'),
            ]);
        }

        $translation = $this->translator->translate($word, $to, $from);

        if (is_null($translation)) {
            $translation = $word;
        }

        return $translation;
    }
726534
public static function merge(array $to, array $from)
    {
        $args = func_get_args();
        $res = array_shift($args);
        while (!empty($args)) {
            $next = array_shift($args);
            foreach ($next as $k => $v) {
                if (is_integer($k)) {
                    isset($res[$k]) ? $res[] = $v : $res[$k] = $v;
                } elseif (is_array($v) && isset($res[$k]) && is_array($res[$k])) {
                    $res[$k] = self::merge($res[$k], $v);
                } else {
                    $res[$k] = $v;
                }
            }
        }
        return $res;
    }
765510
protected function deleteRelationData($from, $to)
    {
        $config  = Config::table($from);
        $content = $config->get();
        unset($content->relations->{$to});
        $config->put($content);
    }
441276
public function renameTable($from, $to)
    {
    	if(!$this->hasTable($from)) {
    		return hst_message('is no has table');
    	}
    	if($this->hasTable($to)) {
    		return hst_message('is has table '.$to);
    	}
        \Schema::connection($this->databaseName)->rename($from, $to);
		return true;
    }