public function generateMessagesFile($path, $noCache = false)
    {
        $splitFiles = Config::get('js-localization.split_export_files');
        $messages = MessageCachingService::getMessagesJson($noCache);

        if ($splitFiles) {
            $this->generateMessageFiles(File::dirname($path), $messages);
        }

        $contents = 'Lang.addMessages(' . $messages . ');';

        File::put($path, $contents);

        $this->line("Generated $path");
    }