src/i18n/TextCollection/i18nTextCollector.php
protected function mergeWithExisting($entitiesByModule)
    {
        // For each module do a simple merge of the default yml with these strings
        foreach ($entitiesByModule as $module => $messages) {
            // Load existing localisations
            $masterFile = "{$this->basePath}/{$module}/lang/{$this->defaultLocale}.yml";
            $existingMessages = $this->getReader()->read($this->defaultLocale, $masterFile);

            // Merge
            if ($existingMessages) {
                $entitiesByModule[$module] = array_merge(
                    $existingMessages,
                    $messages
                );
            }
        }
        return $entitiesByModule;
    }
protected function mergeWithExisting($entitiesByModule)
    {
        // For each module do a simple merge of the default yml with these strings
        foreach ($entitiesByModule as $module => $messages) {
            // Load existing localisations
            $masterFile = "{$this->basePath}/{$module}/lang/{$this->defaultLocale}.yml";
            $existingMessages = $this->getReader()->read($this->defaultLocale, $masterFile);

            // Merge
            if ($existingMessages) {
                $entitiesByModule[$module] = array_merge(
                    $existingMessages,
                    $messages
                );
            }
        }
        return $entitiesByModule;
    }
protected function mergeWithExisting ( $ entitiesByModule ) { // For each module do a simple merge of the default yml with these strings foreach ( $ entitiesByModule as $ module => $ messages ) { // Load existing localisations $ masterFile = "{$this->basePath}/{$module}/lang/{$this->defaultLocale}.yml" ; $ existingMessages = $ this -> getReader ( ) -> read ( $ this -> defaultLocale , $ masterFile ) ; // Merge if ( $ existingMessages ) { $ entitiesByModule [ $ module ] = array_merge ( $ existingMessages , $ messages ) ; } } return $ entitiesByModule ; }
Merge all entities with existing strings

@param array $entitiesByModule
@return array
Merge all entities with existing strings