method countTranslationsDb documentation in bbn\Appui\I18n

Count how many of the strings contained in po files are already in database

function($id_option) { $count = []; $po = $this->getPoFiles($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->getLanguage($id_option); $count[$lang] = 0; foreach($fromPo as $o){ if ($exp = $o->getMsgId()) { $id = $this->db->selectOne('bbn_i18n', 'id', ['exp' => $exp, 'lang' => $source_language]); if ($string = $this->db->selectOne( '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 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.