-
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
Support Blade Templates #147
Comments
How are you currently extracting strings from your files? Do you perhaps have a link to your project? The original goal was to make it easy to extract strings in a similar fashion to the old makepot script, which is only concernced with "regular" PHP files, and to add support for the new JS features. |
Hi @swissspidy
The project is Pressbooks: We use wp-cli to generate the .pot source files. Note: We run your branch for plurals. We do:
We then send the generated files to Transifex: Here's a hack at getting it working with Blade templates. I don't think it's a good idea.
Yes, I understand this, (after the fact). I'm at the point where either either Blade templates (could) work with Thanks! |
We're still trying to work out how best to extend bundled commands like To actually make this work, I think the best approach would be to just pull in the BladeCompiler class, compile into regular PHP and then provide it to the regular parser. |
Thanks for the tip @schlessera. I overrode Commit is here: pressbooks/pb-cli@afe5bb1 Closing bug. |
There is now this PR for supporting Blade template extraction: #304 |
Currently, this CLI command supports PHP and two types of JavaScript extraction. Eventually, the code that does this leads back to / depends on: Gettext\Extractors\PhpCode and Gettext\Utils\JsFunctionsScanner
oscarotero/Gettext
supports several other extractors, one of them is Blade templates.Our WordPress project uses Blade templates. The naming convention for Blade templates is:
/path/to/name.blade.php
The strings inside those files looks like:{{ __( 'My English string', 'my-plugin-name' ) }}
The i18n-command finds, scans, and fails to extract anything meaningful from those files.Please support Blade templates. I'm willing to write a PR to do this if this issue isn't closed as a #wontfix.
Related: #52
The text was updated successfully, but these errors were encountered: