summaryrefslogtreecommitdiff
path: root/scripts/compile-translation.php
blob: 9d48e69dacaf7a6bb5e89b7ec918d83d78fa3609 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<?php
/**
 * Compile a translation file from .po to .mo
 */
chdir(dirname(dirname(__FILE__)));

if ($argc < 2) {
    die("pass language name to update, i.e 'de_DE'\n");
}
$lang = $argv[1];

$langdir = 'data/locales/' . $lang;
if (!is_dir($langdir)) {
    die('There is no language directory: ' . $langdir . "\n");
}


passthru(
    'msgfmt --statistics'
    . ' ' . $langdir . '/LC_MESSAGES/messages.po'
    . ' -o ' . $langdir . '/LC_MESSAGES/messages.mo'
);

?>