civicrm / civistrings Goto Github PK
View Code? Open in Web Editor NEWString extractor for CiviCRM
License: Other
String extractor for CiviCRM
License: Other
civistrings
does not seem to find translations strings in my .mgd.php file that are enclosed in {ts}{/ts}.
I think I'm using best practices but also this feels a bit like a corner case.
In short, I have a mgd.php file that includes a message template. So, I suspect civistrings thinks it's a php file so looks for ts()
. But, since I have message template code, I need it to also find '{ts}{/ts}'.
Should civistrings be patched to handle this situation or is there a different work around I should be using?
For example it will fail on uk.co.compucorp.civicase for things like this:
list(
'query' => $roleQuery,
'where' => $roleWhere
) = self::getRoleQuery([
'can_be_client' => TRUE,
'all_case_roles_selected' => TRUE,
'contact' => $params['contact_involved'],
]);
Syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ',' or ')' on line 99
And also just using []
instead of list
such as this:
[$entityName, $action, $params] = $entity;
FYI @mlutfy this is why it failed during the presentation today.
Perhaps the parser just needs to be updated to the latest version?
The code seems to make assumptions on where to find "autoload.php". Any recommendations on where typically civistrings should be installed vs autoload.php?
I typically install my tools in ~/lib/ and symlink them to ~/bin/, so I have ~/bin/civistrings -> ~/lib/civistrings/bin/civistrings. My CiviCRM codebase is in temporary directories because I am testing the build-unified-pots for multi-version string extraction.
Thanks
When I run civistrings
on a file that has a function that accepts a value by reference (&$var
) I get this error:
Error: Warning: Undefined array key 403 in /home/jamie/projects/ptp/repos/civistrings/vendor/nikic/php-p arser/lib/PhpParser/Lexer.php on line 329
PHP Fatal error: Uncaught TypeError: PhpParser\Lexer::getNextToken(): Return value must be of type int, null returned in /home/jamie/projects/ptp/repos/civistrings/vendor/nikic/php-parser/lib/PhpParser/Lexer .php:369
I experimentally bumped the version of php-parser
from 4.10.2 to the latest 4.13.2 and it resolved the issue.
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.