-
-
Notifications
You must be signed in to change notification settings - Fork 421
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
Find missing translation strings in blade files #1822
Comments
Awesome! However, this seems better suited for the Bladestan project which is already analyzing blade files. To the best of my knowledge (and I could be wrong), but Larastan does not report missing views. |
Yes, my bad. The comment on Reddit misled me. I will close this PR and open one there. Thanks for the info. |
It does actually: https://github.com/larastan/larastan/blob/2.x/src/Types/ViewStringType.php However it doesn't currently seem to be working properly, see #1607 |
Hi, Yes this is possible with Larastan. I even had a working PR about this: #1456 Actually I would say this suits to Larastan more than Bladestan 😄 Because Bladestan compiles the blade files to PHP and then does static analysis. To do this task you do not need to compile the blade files. You can check the linked PR on how it works. If you want, you can try to revive my linked PR and we can add this to Larastan. But it needs to be an optional rule disabled by default. |
I will keep this issue open because it looks like a possible enhancement. Also, I will try to find some time to check the linked PRs and code. If I'm enthusiast enough, I can add it to both library. |
Hello,
I recently developed a package (coding-socks/lost-in-translation) which is able to scan Blade files to identify translation strings and report if the translation for that string is missing from a locale.
u/boreasaurus on Reddit said the following:
My package provides a
lost-in-translation:find {locale}
artisan command which reads all blade files, compiles them to PHP, converts them to tokens, and then finds the relevant nodes in the AST (Abstract syntax tree). As far as I know, this is similar to how static analysis tools work.I'm not sure if I will have enough time in the upcoming days but I would happily work on adding this feature if you think it's a good addition. However, I might require some guidance on where to start because I'm not familiar enough with Larastan/PHPStan.
The text was updated successfully, but these errors were encountered: