src/bbn/appui/i18n.php
public function analyze_js(string $file): array
  {
    $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);
    }
    return array_unique($res);
  }
public function analyze_js(string $file): array
  {
    $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);
    }
    return array_unique($res);
  }
public function analyze_js ( string $ file ) : array { $ 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 ) ; } return array_unique ( $ res ) ; }
Returns the strings contained in the given js file

@param string $file
@return array
Returns the strings contained in the given js file