diff --git a/Module/I18n/Dictionary/Generator.php b/Module/I18n/Dictionary/Generator.php index 6e2ac6c..3989829 100755 --- a/Module/I18n/Dictionary/Generator.php +++ b/Module/I18n/Dictionary/Generator.php @@ -65,7 +65,8 @@ public function __construct( ParserInterface $contextualParser, Factory $factory, Options\ResolverFactory $optionsResolver - ) { + ) + { $this->parser = $parser; $this->contextualParser = $contextualParser; $this->factory = $factory; @@ -96,7 +97,9 @@ public function generate($directory, $outputFilename, $withContext = false, $loc throw new \UnexpectedValueException('No phrases found in the specified dictionary file.'); } foreach ($phraseList as $phrase) { - $this->getDictionaryWriter($outputFilename, $delimiter, $enclosure)->write($phrase); + if ($phrase instanceof Phrase) { + $this->getDictionaryWriter($outputFilename, $delimiter, $enclosure)->write($phrase); + } } $this->writer = null; } diff --git a/Module/I18n/Factory.php b/Module/I18n/Factory.php index bc8421f..03a74c8 100755 --- a/Module/I18n/Factory.php +++ b/Module/I18n/Factory.php @@ -8,6 +8,7 @@ * http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) * Please see LICENSE.txt for the full text of the OSL 3.0 license */ + namespace Experius\MissingTranslations\Module\I18n; /** @@ -65,12 +66,14 @@ public function createDictionary() */ public function createPhrase(array $data) { - return new Dictionary\Phrase( - $data['phrase'], - $data['translation'], - isset($data['context_type']) ? $data['context_type'] : null, - isset($data['context_value']) ? $data['context_value'] : null, - isset($data['quote']) ? $data['quote'] : null - ); + if ("" != $data['phrase']) { + return new Dictionary\Phrase( + $data['phrase'], + $data['translation'], + isset($data['context_type']) ? $data['context_type'] : null, + isset($data['context_value']) ? $data['context_value'] : null, + isset($data['quote']) ? $data['quote'] : null + ); + } } }