method getPoFiles documentation in bbn\Appui\I18n
Returns an array containing the po files found for the id_option
function($id_option)
{
if (!empty($id_option) && ($o = $this->options->option($id_option))
&& ($parent = $this->options->parent($id_option))
&& defined($parent['code'])
) {
$tmp = [];
// @var $to_explore the path to explore
$to_explore = $this->getPathToExplore($id_option);
// @var $locale_dir locale dir in the path
$locale_dir = $this->getLocaleDirPath($id_option);
$dirs = \bbn\File\Dir::getDirs($locale_dir) ?: [];
$languages = array_map(
function ($a) {
return X::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 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-2023
BBN Solutions