1<?php
2
3if (!defined('PHPLISTINIT')) {
4    die();
5}
6
7if (empty($GLOBALS['commandline'])) {
8    echo $GLOBALS['I18N']->get('This page can only be called from the commandline');
9
10    return;
11}
12$locale_root = dirname(__FILE__).'/locale/';
13
14$force = isset($cline['f']);
15
16if (is_dir($locale_root)) {
17    $dir = opendir($locale_root);
18    while ($lan = readdir($dir)) {
19        if (is_file($locale_root.'/'.$lan.'/phplist.po')) {
20            cl_output($lan);
21            $lastUpdate = getConfig('lastlanguageupdate-'.$lan);
22            $thisUpdate = filemtime($locale_root.'/'.$lan.'/phplist.po');
23            if ($force || $thisUpdate > $lastUpdate) {
24                cl_output(s('Initialising language').' '.$lan);
25                $GLOBALS['I18N']->initFSTranslations($lan);
26            } else {
27                cl_output(s('Up to date'));
28            }
29        }
30    }
31}
32