Example #1
0
 public function __construct($attributes = array())
 {
     parent::__construct($attributes);
     $this->setTranslations();
     register_shutdown_function(function () {
         $locales = $this->getLocales();
         foreach ($locales as $locale => $options) {
             $path = $this->getFileFullPath($locale);
             $translations = $this->translations[$locale];
             if ($translations != $this->loaded[$locale]) {
                 $contents = Support\get_file_contents($path);
                 $contents = array_merge($translations, $contents);
                 $contents = Yaml::dump($contents, 1);
                 Support\dump_file($path, $contents);
             }
         }
     });
 }
Example #2
0
 public function __construct($attributes = array())
 {
     parent::__construct($attributes);
     $this->translationRepository = app('translations-db-repo');
     $this->setTranslations();
 }