method analyzeJs documentation in bbn\Appui\I18n
Returns the strings contained in the given js file
function(string $file)
{
$res = [];
$js = file_get_contents($file);
if ($tmp = \Gettext\Translations::fromJsCodeString(
$js, [
'functions' => [
'_' => 'gettext',
'bbn._' => 'gettext'
],
'file' => $file
]
)
) {
foreach ($tmp->getIterator() as $r => $tr){
$res[] = $tr->getOriginal();
}
$this->parser->mergeWith($tmp);
}
if (preg_match_all('/`([^`]*)`/', $js, $matches)) {
foreach ($matches[0] as $st){
if ($tmp = \Gettext\Translations::fromVueJsString(
''.$st.'', [
'functions' => [
'_' => 'gettext',
'bbn._' => 'gettext'
],
'file' => $file
]
)
) {
foreach ($tmp->getIterator() as $r => $tr){
$res[] = $tr->getOriginal();
}
$this->parser->mergeWith($tmp);
}
}
}
/*if($file === '/home/thomas/domains/apstapp2.thomas.lan/_appui/vendor/bbn/appui-task/src/components/tab/tracker/tracker.js'){
die(\bbn\X::hdump($res, $js));
}*/
return array_unique($res);
}
Returns the strings contained in the given js file BBN is a suite of PHP and JS libraries and VueJS components - all open-source! bbn.io, build applications, the quick way
This website uses cookies to ensure you get the best experience on our website.
© 2011-2025
BBN Solutions