php-gettext / robo Goto Github PK
View Code? Open in Web Editor NEWRobo task to extract gettext values from files
License: MIT License
Robo task to extract gettext values from files
License: MIT License
Yeah, that's basically it. Because the Twig extractor can't be passed an instance of Twig to use, it always creates one with no extensions loaded, and then throws an error if it hits any custom extension items of any kind.
I tried to get around it by copying the task itself and changing it to fetch Twig from a container so I can hand it my Laravel container to get Twig out of, but that leads to a whole new set of problems; since the PHP reader tries to include any PHP file it finds before it reads it for the functions, forcing the container to load crashes that extractor with a "duplicate class" error, because it tries to load the class, even thought the container already loaded it...
Class 'Robo\Task\BaseTask' not found
"require": {
"gettext/gettext": "v4.1.0",
"gettext/robo": "v3.0.0"
}
Add support to save translations into JSON
Hello,
Would you agree on adding PHTML support?
I opened a PR that works in my use case: #6.
Best,
Juliette
I'm using gettext/gettext and gettext/robo for translating two different (but interconnected) pages. The first I'm only using it to translate the js-files with no problem. The second one, however, translates both php- and js-files and Robo keeps throwing this error multiple times (presumably when it finds a translatable string.
This doesn't seem to bother much though since the Robo script finishes the scanning and generates a valid pot-file in the end.
Here's the error that gets printed when Robo has finished scanning:
ERROR: Invalid argument supplied for foreach() in [...]/vendor/gettext/gettext/src/Utils/MultidimensionalArrayTrait.php:78
Robofile.php:
require "../vendor/autoload.php";
class RoboFile extends \Robo\Tasks
{
use Gettext\Robo\GettextScanner;
public function gettext()
{
$this->taskGettextScanner()
->extract("../", "/.*\.js/")
->extract("../", "/.*\.php/")
->generate("messages.pot")
->run();
}
}
Running a debugger when Robo runs gives the error in the title.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.