133 $components = $finder->getComponents();
135 $updatedMessages = [];
137 foreach ( $components as $key => $info ) {
138 $logger->logInfo(
"Updating component $key" );
140 $originFiles = $this->fetchFiles( $fetcherFactory, $info[
'orig'] );
141 $remotePath = $this->expandRemotePath( $info, $repos );
143 $remoteFiles = $this->fetchFiles( $fetcherFactory, $remotePath );
144 }
catch ( \Exception
$e ) {
145 $logger->logError( __METHOD__ .
": Unable to fetch messages from $remotePath" );
149 if ( $remoteFiles === [] ) {
154 $originMessages = $this->readMessages( $readerFactory, $originFiles );
155 $remoteMessages = $this->readMessages( $readerFactory, $remoteFiles );
157 if ( !isset( $remoteMessages[
'en'] ) ) {
165 $forbiddenKeys = $this->findChangedTranslations(
166 $originMessages[
'en'],
167 $remoteMessages[
'en']
171 unset( $originMessages[
'en'], $remoteMessages[
'en'] );
174 foreach ( $remoteMessages as $language => $remoteTranslations ) {
176 $originTranslations = [];
177 if ( isset( $originMessages[$language] ) ) {
178 $originTranslations = $originMessages[$language];
181 $updatedTranslations = $this->findChangedTranslations(
188 if ( $updatedTranslations === [] ) {
192 if ( !isset( $updatedMessages[$language] ) ) {
193 $updatedMessages[$language] = [];
198 $updatedMessages[$language] += $updatedTranslations;
202 return $updatedMessages;