add script to update language translation file from master file
git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@519 b3834d28-1941-0410-a4f8-b48e95affb8f
This commit is contained in:
parent
540b80bc0c
commit
ee4a7b7100
1 changed files with 25 additions and 0 deletions
25
scripts/update-translation.php
Normal file
25
scripts/update-translation.php
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Update single gettext translation from
|
||||||
|
* gettext base file
|
||||||
|
*/
|
||||||
|
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(
|
||||||
|
'msgmerge --update --backup=off'
|
||||||
|
. ' ' . $langdir . '/LC_MESSAGES/messages.po'
|
||||||
|
. ' data/locales/messages.po'
|
||||||
|
);
|
||||||
|
|
||||||
|
?>
|
Loading…
Reference in a new issue