Dotclear

source: build-tools/make-l10n.php @ 3877:e68b76561491

Revision 3877:e68b76561491, 744 bytes checked in by franck <carnet.franck.paul@…>, 7 years ago (diff)

Back to the old array() notation for build tools (they still may be used with old PHP versions)

  • Property exe set to *
Line 
1#!/usr/bin/env php
2<?php
3$license_block = <<<EOF
4/**
5 * @package Dotclear
6 *
7 * @copyright Olivier Meunier & Association Dotclear
8 * @copyright GPL-2.0-only
9 */
10EOF;
11
12require dirname(__FILE__) . '/../inc/libs/clearbricks/common/lib.l10n.php';
13
14$path = (!empty($_SERVER['argv'][1])) ? $_SERVER['argv'][1] : getcwd();
15$path = realpath($path);
16
17$cmd = 'find ' . $path . ' -type f -name \'*.po\'';
18exec($cmd, $eres, $ret);
19
20$res = array();
21
22foreach ($eres as $f) {
23    $dest = dirname($f) . '/' . basename($f, '.po') . '.lang.php';
24    echo "l10n file " . $dest . ": ";
25
26    if (l10n::generatePhpFileFromPo(dirname($f) . '/' . basename($f, '.po'), $license_block)) {
27        echo 'OK';
28    } else {
29        echo 'FAILED';
30    }
31    echo "\n";
32}
33?>
Note: See TracBrowser for help on using the repository browser.

Sites map