diff --git a/src/Drivers/Translation.php b/src/Drivers/Translation.php index 5ec47ef..ba6afd8 100644 --- a/src/Drivers/Translation.php +++ b/src/Drivers/Translation.php @@ -59,7 +59,7 @@ public function saveMissingTranslations($language = false) */ public function getSourceLanguageTranslationsWith($language) { - $sourceTranslations = $this->allTranslationsFor($this->sourceLanguage); + $sourceTranslations = $this->allTranslationsFor(app()->config['app']['locale']); $languageTranslations = $this->allTranslationsFor($language); return $sourceTranslations->map(function ($groups, $type) use ($language, $languageTranslations) { @@ -67,7 +67,7 @@ public function getSourceLanguageTranslationsWith($language) $translations = $translations->toArray(); array_walk($translations, function (&$value, $key) use ($type, $group, $language, $languageTranslations) { $value = [ - $this->sourceLanguage => $value, + app()->config['app']['locale'] => $value, $language => $languageTranslations->get($type, collect())->get($group, collect())->get($key), ]; }); @@ -94,7 +94,7 @@ public function filterTranslationsFor($language, $filter) return $allTranslations->map(function ($groups, $type) use ($language, $filter) { return $groups->map(function ($keys, $group) use ($language, $filter) { return collect($keys)->filter(function ($translations, $key) use ($group, $language, $filter) { - return strs_contain([$group, $key, $translations[$language], $translations[$this->sourceLanguage]], $filter); + return strs_contain([$group, $key, $translations[$language], $translations[app()->config['app']['locale']]], $filter); }); })->filter(function ($keys) { return $keys->isNotEmpty();