Open rivalex opened 8 months ago
Hi Joedixon, by any chance, have you had time to see this error?
Hi Joedixon ... I find my escape room 😅
/** * Load the messages for the given locale. * * @param string $locale * @param string $group * @param string $namespace * @return array */ public function load($locale, $group, $namespace = null) { if ($group == '*' && $namespace == '*') { return $this->translation->getSingleTranslationsFor($locale)->get('single', collect())->toArray(); } if (is_null($namespace) || $namespace == '*') { return $this->translation->getGroupTranslationsFor($locale)->filter(function ($value, $key) use ($group) { return $key === $group; })->first(); } return $this->translation->getGroupTranslationsFor($locale)->filter(function ($value, $key) use ($group, $namespace) { return $key === "{$namespace}::{$group}"; })->first(); }
I commented the first IF in load function in src/ContractDatabaseLoader.php file
if ($group == '*' && $namespace == '*') { return $this->translation->getSingleTranslationsFor($locale)->get('single', collect())->toArray(); }
All works fine ... migrations done and sync all files to DB. Then I remove comments and now all works on DB.
Hope this feedback can help
ciao
Alessandro
Hello @rivalex ,would you kindly raise a PR for this fix?
I was able to integrate your solution perfectly into my App. I integrated your solution with Laravel-Lang, so I can add/remove already partially translated languages. I also managed to implement views so as to filter translations that have not yet been translated, mark all non translated string, completion percentage etc.
My app is published on Forge from a GIT repository.
2 problems
At this point I would like to move the translations to the database but when I change the driver from file to database I always get the same error, also migrating others tables:
I also tried manually creating the migrations, and creating the tables. Everything works but if I change the driver from file to database I always get the usual error, both in the console and online.
Thanks in advance for the support