Skip to content

Commit

Permalink
auto produce locale *.mo
Browse files Browse the repository at this point in the history
  • Loading branch information
Xi-Plus committed Apr 30, 2016
1 parent f41066d commit 31dfd13
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
3 changes: 3 additions & 0 deletions config/default_config.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,11 @@

# allow locale list
$config["locale"] = array(
"de_DE",
"en_US",
"ja_JP",
"pl_PL",
"ru_RU",
"zh_TW"
);

Expand Down
14 changes: 14 additions & 0 deletions install/locale.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php
$isCLI = ( php_sapi_name() == 'cli' );
if(!$isCLI)
{
die("Please run me from the console - not from a web-browser!");
}

require("../config/config.php");
chdir("../locale");
foreach ($config["locale"] as $locale) {
system("msgfmt ".$locale."/LC_MESSAGES/login.po -o ".$locale."/LC_MESSAGES/login.mo");
echo "msgfmt ".$locale."\n";
}
?>

0 comments on commit 31dfd13

Please sign in to comment.