Code formatting

This commit is contained in:
Matej Bačo
2022-10-07 07:56:01 +00:00
parent 11eaf68adf
commit c6792c1034
+7 -8
View File
@@ -18,7 +18,7 @@ $cli
$mainLocale = new Locale($mainLanguage);
foreach ($mainLocale->getTranslations() as $key => $value) {
if(!empty($value)) {
if (!empty($value)) {
$mainTranslations[] = $key;
}
}
@@ -30,31 +30,30 @@ $cli
$translations = $locale->getTranslations();
$missing = [];
foreach ($mainTranslations as $translation) {
if(empty($translations[$translation])) {
if (empty($translations[$translation])) {
$missing[] = $translation;
}
}
if(\count($missing) <= 0) {
if (\count($missing) <= 0) {
$type !== 'json' && Console::success('Locale "' . $language . '" is fully translated.');
} else {
$type !== 'json' && Console::error('Locale "' . $language . '" is missing ' . \count($missing) . ' translations.');
if($type === 'debug') {
if ($type === 'debug') {
foreach ($missing as $key) {
Console::log('"' . $key . '" missing in "' . $language . '".');
}
} else if ($type === 'json') {
} elseif ($type === 'json') {
$results[$language] = $missing;
}
}
}
$type !== 'json' && Console::info('To get detailed information about missing translations, run the command with --type=debug parameter. Use --type=json to get JSON formatted results.');
if($type === 'json') {
if ($type === 'json') {
\var_dump($results);
Console::log(\json_encode($results));
}
});