-
Notifications
You must be signed in to change notification settings - Fork 52
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
Translators comment audit - tell me in which files the different comment is #227
Comments
Interesting suggestion!
I don't think it's as easy as that. Warnings like that are printed once all the processing is done and all translations have been extracted. For example: If you have the same string used in 10 different files, but in one of the files it uses a different comment, we don't know which file that is. We only know the 10 file names, and the list of comments, but not which comment belongs to which file.
I don't think it takes that long :-) Searching for a string in your IDE will quickly show an overview of all occurrences, and then you scan scan through the comments. And the POT file contains all file names too. |
Ah ok, so the underlying tool doesnt report that - makes sense why you cannot report, which files are incorrect.
That would actually be sufficient too! Just output the different translators comments, instead of just "3 different translator comments." This would make fixing these issues massively easier - talking from days to 10 minutes, since I can just search for the translators comment.
Unfortunately, it really does take ages. Since translators comments can be added in various ways (same line, previous line, phpdoc comment style, comment style,...) this means each and every string occurence has to be checked. |
In #318 I made the output as follows:
Before:
|
Thank you. Is this available in the latest nightly already? |
Not sure. But |
Doesn't work unfortunately. Tried It shows up fine, but it doesn't work:
I'm on |
I have 1000s of files (from different projects that share a text-domain since its the same theme and texts just with slightly different design) with this string:
'Hi %s'
I get the following error:
Warning: The string "Hi %s," has 3 different translator comments. (some/file.php)
Since wp-cli knows in which these different translator comments are, could you please also output this info to the user?
Since I have about 7 of these warnings, it would take weeks to sift through all files and check where/what is different, since sometimes strings are on the same line, sometimes on the previous,...
The text was updated successfully, but these errors were encountered: