/** * Get the file translations & the database translations, overwrite the file translations by db translations * @return TranslationGroup */ public function getFileAndDatabaseMergedTranslations() { $allFileTranslations = $this->fileTranslations->all(); $allDatabaseTranslations = $this->databaseTranslations->allFormatted(); foreach ($allFileTranslations as $locale => $fileTranslation) { foreach ($fileTranslation as $key => $translation) { if (isset($allDatabaseTranslations[$locale][$key])) { $allFileTranslations[$locale][$key] = $allDatabaseTranslations[$locale][$key]; unset($allDatabaseTranslations[$locale][$key]); } } } $this->addDatabaseOnlyTranslations($allFileTranslations, $allDatabaseTranslations); $this->filterOnlyActiveLocales($allFileTranslations); return new TranslationGroup($allFileTranslations); }