src/bbn/appui/i18n.php
public function get_po_files($id_option){
    if (!empty($id_option) && ($o = options::get_instance()->option($id_option)) &&
    ($parent = options::get_instance()->parent($id_option)) &&
    defined($parent['code']) ){
      $tmp = [];
      // @var  $to_explore the path to explore 
      $to_explore = constant($parent['code']).$o['code'];
      // @var  $locale_dir locale dir in the path
      $locale_dir = dirname($to_explore).'/locale';
      $dirs = \bbn\file\dir::get_dirs($locale_dir) ?: [];
      $languages = array_map(function($a){
        return basename($a);
      }, $dirs) ?: [];
      if ( !empty($languages) ){

        foreach ( $languages as $lng ){
          // the path of po and mo files 
          $idx = is_file($locale_dir.'/index.txt') ? file_get_contents($locale_dir.'/index.txt') : '';
          if ( is_file($locale_dir.'/'.$lng.'/LC_MESSAGES/'.$o['text'].$idx.'.po') ){
            $tmp[$lng]= $locale_dir.'/'.$lng.'/LC_MESSAGES/'.$o['text'].$idx.'.po';
          }

        }

      }

      return $tmp;
    }
  }
public function get_po_files($id_option){
    if (!empty($id_option) && ($o = options::get_instance()->option($id_option)) &&
    ($parent = options::get_instance()->parent($id_option)) &&
    defined($parent['code']) ){
      $tmp = [];
      // @var  $to_explore the path to explore 
      $to_explore = constant($parent['code']).$o['code'];
      // @var  $locale_dir locale dir in the path
      $locale_dir = dirname($to_explore).'/locale';
      $dirs = \bbn\file\dir::get_dirs($locale_dir) ?: [];
      $languages = array_map(function($a){
        return basename($a);
      }, $dirs) ?: [];
      if ( !empty($languages) ){

        foreach ( $languages as $lng ){
          // the path of po and mo files 
          $idx = is_file($locale_dir.'/index.txt') ? file_get_contents($locale_dir.'/index.txt') : '';
          if ( is_file($locale_dir.'/'.$lng.'/LC_MESSAGES/'.$o['text'].$idx.'.po') ){
            $tmp[$lng]= $locale_dir.'/'.$lng.'/LC_MESSAGES/'.$o['text'].$idx.'.po';
          }

        }

      }

      return $tmp;
    }
  }
public function get_po_files ( $ id_option ) { if ( ! empty ( $ id_option ) && ( $ o = options :: get_instance ( ) -> option ( $ id_option ) ) && ( $ parent = options :: get_instance ( ) -> parent ( $ id_option ) ) && defined ( $ parent [ 'code' ] ) ) { $ tmp = [ ] ; // @var  $to_explore the path to explore  $ to_explore = constant ( $ parent [ 'code' ] ) . $ o [ 'code' ] ; // @var  $locale_dir locale dir in the path $ locale_dir = dirname ( $ to_explore ) . '/locale' ; $ dirs = \ bbn \ file \ dir :: get_dirs ( $ locale_dir ) ? : [ ] ; $ languages = array_map ( function ( $ a ) { return basename ( $ a ) ; } , $ dirs ) ? : [ ] ; if ( ! empty ( $ languages ) ) { foreach ( $ languages as $ lng ) { // the path of po and mo files  $ idx = is_file ( $ locale_dir . '/index.txt' ) ? file_get_contents ( $ locale_dir . '/index.txt' ) : '' ; if ( is_file ( $ locale_dir . '/' . $ lng . '/LC_MESSAGES/' . $ o [ 'text' ] . $ idx . '.po' ) ) { $ tmp [ $ lng ] = $ locale_dir . '/' . $ lng . '/LC_MESSAGES/' . $ o [ 'text' ] . $ idx . '.po' ; } } } return $ tmp ; } }
Returns an array containing the po files found for the id_option

@param $id_option
@return void
Returns an array containing the po files found for the id_option