src/bbn/appui/i18n.php
public function count_translations_db($id_option){
    $count = [];
    $po = $this->get_po_files($id_option);
    if (!empty($po)){
      foreach ($po as $lang => $file) {
        $fileHandler = new \Sepia\PoParser\SourceHandler\FileSystem($file);
        $poParser = new \Sepia\PoParser\Parser($fileHandler);
        $Catalog  = \Sepia\PoParser\Parser::parseFile($file);
        $fromPo = $Catalog->getEntries();
        $source_language = $this->get_language($id_option);

        $count[$lang] = 0;
        foreach( $fromPo as $o ){
          if ( $exp = $o->getMsgId() ){
            $id = $this->db->select_one('bbn_i18n', 'id', ['exp' => $exp, 'lang' => $source_language]);
            if ( $string = $this->db->select_one('bbn_i18n_exp', 'expression', [
              'id_exp' => $id,
              'lang' => $lang
            ]) ){
              $count[$lang]++;
            }
          }

        }

      }

    }

    return $count;
  }
public function count_translations_db($id_option){
    $count = [];
    $po = $this->get_po_files($id_option);
    if (!empty($po)){
      foreach ($po as $lang => $file) {
        $fileHandler = new \Sepia\PoParser\SourceHandler\FileSystem($file);
        $poParser = new \Sepia\PoParser\Parser($fileHandler);
        $Catalog  = \Sepia\PoParser\Parser::parseFile($file);
        $fromPo = $Catalog->getEntries();
        $source_language = $this->get_language($id_option);

        $count[$lang] = 0;
        foreach( $fromPo as $o ){
          if ( $exp = $o->getMsgId() ){
            $id = $this->db->select_one('bbn_i18n', 'id', ['exp' => $exp, 'lang' => $source_language]);
            if ( $string = $this->db->select_one('bbn_i18n_exp', 'expression', [
              'id_exp' => $id,
              'lang' => $lang
            ]) ){
              $count[$lang]++;
            }
          }

        }

      }

    }

    return $count;
  }
public function count_translations_db ( $ id_option ) { $ count = [ ] ; $ po = $ this -> get_po_files ( $ id_option ) ; if ( ! empty ( $ po ) ) { foreach ( $ po as $ lang => $ file ) { $ fileHandler = new \ Sepia \ PoParser \ SourceHandler \ FileSystem ( $ file ) ; $ poParser = new \ Sepia \ PoParser \ Parser ( $ fileHandler ) ; $ Catalog = \ Sepia \ PoParser \ Parser :: parseFile ( $ file ) ; $ fromPo = $ Catalog -> getEntries ( ) ; $ source_language = $ this -> get_language ( $ id_option ) ; $ count [ $ lang ] = 0 ; foreach ( $ fromPo as $ o ) { if ( $ exp = $ o -> getMsgId ( ) ) { $ id = $ this -> db -> select_one ( 'bbn_i18n' , 'id' , [ 'exp' => $ exp , 'lang' => $ source_language ] ) ; if ( $ string = $ this -> db -> select_one ( 'bbn_i18n_exp' , 'expression' , [ 'id_exp' => $ id , 'lang' => $ lang ] ) ) { $ count [ $ lang ] ++ ; } } } } } return $ count ; }
Count how many of the strings contained in po files are already in database

@param [type] $id_option
@return void
Count how many of the strings contained in po files are already in database