* change for en to de lang.

This commit is contained in:
wangyidong
2019-07-15 08:07:30 +08:00
parent 136e68e3dc
commit 00a096c5ee
3 changed files with 25 additions and 0 deletions
+23
View File
@@ -0,0 +1,23 @@
#!/usr/bin/env php
<?php
/* Set the extpath and cconv binary. */
if(empty($argv[1])) die("Must give the module path.\n");
$extPath = $argv[1];
foreach(glob("$extPath/module/*") as $moduleName)
{
/* Convert the main lang file. */
$moduleLangPath = realpath($moduleName) . '/lang/';
$defaultLangFile = $moduleLangPath . 'en.php';
$targetLangFile = $moduleLangPath . 'de.php';
if(file_exists($defaultLangFile)) system("cp -r $defaultLangFile $targetLangFile");
/* Convert the extened lang file. */
foreach(glob("$moduleName/ext/lang/en/*.php") as $extLangFile)
{
$pathOfTW = dirname(dirname($extLangFile)) . "/de";
$extFileName = basename($extLangFile);
if(!is_dir($pathOfTW)) mkdir($pathOfTW);
system("cp -r $extLangFile $pathOfTW/$extFileName");
}
}