Code Duplication    Length = 28-28 lines in 2 locations

src/Commands/MissingCommand.php 2 locations

@@ 63-90 (lines=28) @@
60
        $this->translateJsonFiles();
61
    }
62
63
    public function translatePhpFiles()
64
    {
65
        $this->line('Translating PHP files');
66
67
        $missingCount = 0;
68
        foreach ($this->targetLanguages as $targetLanguage) {
69
            $missingTranslations = $this->phpTranslator->getMissingTranslations($targetLanguage);
70
            $missingCount += count($missingTranslations);
71
72
            $this->line(implode(' ', [
73
                'Found',
74
                count($missingTranslations),
75
                'missing keys in',
76
                $targetLanguage,
77
            ]));
78
        }
79
80
        $bar = $this->output->createProgressBar($missingCount);
81
        $bar->start();
82
83
        $this->phpTranslator->translateMissing($this->targetLanguages, function () use ($bar) {
84
            $bar->advance();
85
        });
86
87
        $bar->finish();
88
89
        $this->info("\nTranslated ".$missingCount.' missing language keys.');
90
    }
91
92
    public function translateJsonFiles()
93
    {
@@ 92-119 (lines=28) @@
89
        $this->info("\nTranslated ".$missingCount.' missing language keys.');
90
    }
91
92
    public function translateJsonFiles()
93
    {
94
        $this->line('Translating JSON files');
95
96
        $missingCount = 0;
97
        foreach ($this->targetLanguages as $targetLanguage) {
98
            $missingTranslations = $this->jsonTranslator->getMissingTranslations($targetLanguage);
99
            $missingCount += count($missingTranslations);
100
101
            $this->line(implode(' ', [
102
                'Found',
103
                count($missingTranslations),
104
                'missing keys in',
105
                $targetLanguage,
106
            ]));
107
        }
108
109
        $bar = $this->output->createProgressBar($missingCount);
110
        $bar->start();
111
112
        $this->jsonTranslator->translateMissing($this->targetLanguages, function () use ($bar) {
113
            $bar->advance();
114
        });
115
116
        $bar->finish();
117
118
        $this->info("\nTranslated ".$missingCount.' missing language keys.');
119
    }
120
}
121