/** * Normalizes the phrase with the given phrase key by comparing it to the given reference phrase * * @param string $phraseKey * @param Phrase $referencePhrase * @param boolean $prefillContent whether to pre-fill the phrase with the default language's content (true) or not (false) */ public function normalizePhrase($phraseKey, $referencePhrase, $prefillContent) { $this->phrases[$phraseKey]->setGroupID($referencePhrase->getGroupID()); if ($prefillContent) { $phraseValues = $this->phrases[$phraseKey]->getPhraseValues(); $referenceValues = $referencePhrase->getPhraseValues(); foreach ($phraseValues as $subKey => $value) { if ($value == '') { $this->phrases[$phraseKey]->setPhraseValue($subKey, $referenceValues[$subKey]); } } } }