<commit_before><?php

if (!defined('PHPLISTINIT')) die();

if (empty($GLOBALS['commandline'])) {
  print $GLOBALS['I18N']->get("This page can only be called from the commandline");
  return;
}
ob_end_clean();
print ClineSignature();
ob_start();

$locale_root = dirname(__FILE__).'/locale/';

if (is_dir($locale_root)) {
  $dir = opendir($locale_root);
  while ($lan = readdir($dir)) {
    if (is_file($locale_root.'/'.$lan.'/phplist.po')) {
      cl_output($lan);
      $lastUpdate = getConfig('lastlanguageupdate-'.$lan);
      $thisUpdate = filemtime($locale_root.'/'.$lan.'/phplist.po');
      if ($thisUpdate > $lastUpdate) {
        cl_output(s('Initialising language').' '.$lan);
        $GLOBALS['I18N']->initFSTranslations($lan);
      } else {
        cl_output(s('Up to date'));
      }
    }
  }
}<commit_msg>add force option to initlanguages<commit_after><?php

if (!defined('PHPLISTINIT')) die();

if (empty($GLOBALS['commandline'])) {
  print $GLOBALS['I18N']->get("This page can only be called from the commandline");
  return;
}
ob_end_clean();
print ClineSignature();
ob_start();

$locale_root = dirname(__FILE__).'/locale/';

$force = isset($cline['f']);

if (is_dir($locale_root)) {
  $dir = opendir($locale_root);
  while ($lan = readdir($dir)) {
    if (is_file($locale_root.'/'.$lan.'/phplist.po')) {
      cl_output($lan);
      $lastUpdate = getConfig('lastlanguageupdate-'.$lan);
      $thisUpdate = filemtime($locale_root.'/'.$lan.'/phplist.po');
      if ($force || $thisUpdate > $lastUpdate) {
        cl_output(s('Initialising language').' '.$lan);
        $GLOBALS['I18N']->initFSTranslations($lan);
      } else {
        cl_output(s('Up to date'));
      }
    }
  }
}
{'fraction_non_alphanumeric': 0.20529411764705882, 'fraction_numerical': 0.004705882352941176, 'mean_word_length': 3.9020172910662825, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4811608', 'n_tokens_mistral': 610, 'n_tokens_neox': 602, 'n_words': 103}