-
-
Notifications
You must be signed in to change notification settings - Fork 135
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
Call to a member function insert() on boolean #228
Comments
I'll check it out |
@mihaikelemen Could you provide more info?
|
Hi @briedis , Sorry for the late response. I'm using this approach with the second argument for quite a while, based on the docs (see bellow). It is a handful approach. Mihai |
This the actual code (part of it) that generates the po file for a given locale (in this case $files->files()
->name('/(.*)\.(tpl|php)/')
->depth('>=1')
->in($dirs);
$translations = new Translations();
$translations->setLanguage('ro_RO');
$translations->setDomain('messages');
# locale directory path
$dir = sprintf('%s%s/', $config->get('environment.locales'), 'ro_RO');
$potfile = sprintf('%s%s.po', $dir, $translations->getDomain());
if (!$filesystem->exists($dir)) {
$filesystem->mkdir($dir, 0755);
$filesystem->touch($potfile);
}
foreach ($files as $file) {
$translations->addFromPhpCodeFile($file->getPathname());
}
if ($filesystem->exists($potfile)) {
$translations->mergeWith(Translations::fromPoFile($potfile));
}
$translations->toPoFile($potfile); |
Sorry @mihaikelemen for the delay, but I managed to run into this issue on my own too. A PR is created for the v4 branch. Actually the code to reproduce the issue was much simpler - just scan a file for one domain, but the file contains a single pgettext call without any strings from the domain you are searching for. |
Hi @briedis , Mihai |
Scanning PHP code fails on v4.7 for the this type of translation
__("Foo %s", "bar")
This is working on v4.6.3
The text was updated successfully, but these errors were encountered: