-
Notifications
You must be signed in to change notification settings - Fork 1.9k
feat: [Commands] lang:find
show bad keys when scanning
#8149
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
$tableBadRows[] = [$key, $value]; | ||
} | ||
|
||
CLI::table($tableBadRows, ['№', 'Bad key']); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you need the No. for? I want the file paths.
CLI::table($tableBadRows, ['№', 'Bad key']); | |
CLI::table($tableBadRows, ['№', 'Bad Key']); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The number is just for understanding which line. I think file paths are not an option to show. Since one language key can be in ~1000 different files. How do you see it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If a bad key is used in 1000 files, then those 1000 locations should be shown.
No. | Bad Key | File |
---|---|---|
1 | BadKey1 | path/to/file1.php |
2 | BadKey1 | path/to/file2.php |
... | ... | ... |
1000 | BadKey1 | path/to/file1000.php |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Heh, I'll try to do it.
$foundLanguageKeys[0] = array_replace_recursive($findInFile[0], $foundLanguageKeys[0]); | ||
$foundLanguageKeys[1] = array_merge($findInFile[1], $foundLanguageKeys[1]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The variable names are difficult to understand. Don't use [0]
or [1]
.
Name meaningful variable names.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good. this is because the function returns multiple values instead of one
Do you have a suggestion on how to check existing translations from app/Language/? Should there be a separate lang |
@neznaika0 You can create any classes for the commend. |
Description
I tried to add a list of bad keys when scanning.
Now this is not exactly what @kenjis was talking about, but it's still better than nothing
Example:
Originally posted by @kenjis in #7896 (comment)
Checklist: