Merge branch '3.6' of github.com:alchemy-fr/Phraseanet into 3.6

This commit is contained in:
Nicolas Le Goff
2012-02-07 12:01:45 +01:00
25 changed files with 3876 additions and 3895 deletions

View File

@@ -27,6 +27,8 @@ $finder
->name('.gitmodules')
->name('.gitignore')
->name('check_cs.php')
->name('launchpadToLocales.php')
->name('localesToLaunchpad.php')
->name('pom.xml')
->name('vendors.php')
->name('builder.php')

View File

@@ -45,6 +45,7 @@ $finder
->notName(basename(__FILE__))
->exclude('.git')
->exclude('vendor')
->exclude('Doctrine/Proxies')
;
$count = 0;

66
launchpadToLocales.php Executable file
View File

@@ -0,0 +1,66 @@
#!/usr/bin/env php
<?php
/*
* Upgrade current locale files to the latest launchpad version :
*
* You first need to download the latest launchpad version, untar the file, then
* launch this command with the name of the directory where the po files are as
* argument.
*
* @example ./launchpadToLocales.php phraseanet
*
* @see https://translations.launchpad.net/phraseanettranslation/trunk/+pots/phraseanettrunktemplate
*
*/
require_once __DIR__ . '/lib/Alchemy/Phrasea/Core.php';
use Symfony\Component\Finder\Finder;
\Alchemy\Phrasea\Core::initAutoloads();
if (!isset($argv[1]) || !is_dir(__DIR__ . '/' . $argv[1]))
{
echo "You need to specify a directory with the latest launchpad locales" . PHP_EOL;
exit(1);
}
chdir(__DIR__);
$finder = new Finder();
$finder
->files()
->name('phraseanet-*.po')
->in(
array(
__DIR__ . '/' . $argv[1],
)
)
;
$count = 0;
foreach ($finder as $file)
{
preg_match('/phraseanet-(.*)\.po/', $file->getFileName(), $matches);
$current_file = $file->getRealPath();
$locale = $matches[1];
$dest_file = __DIR__ . '/locale/' . $locale . '/LC_MESSAGES/phraseanet.po';
if (!file_exists($dest_file))
{
echo "Destination $dest_file does not exists" . PHP_EOL;
continue;
}
system(sprintf('cp %s %s', $current_file, $dest_file));
$count++;
}
echo "$count files upgraded" . PHP_EOL;
exit($count ? 1 : 0);

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

47
localesToLaunchPad.php Executable file
View File

@@ -0,0 +1,47 @@
#!/usr/bin/env php
<?php
/*
* Prepare the file to be uploaded on launchpad
*
* Fetch every translation at the root of ./locale, next to the main pot file
*
* @see https://translations.launchpad.net/phraseanettranslation/trunk/+pots/phraseanettrunktemplate
*
*/
require_once __DIR__ . '/lib/Alchemy/Phrasea/Core.php';
use Symfony\Component\Finder\Finder;
\Alchemy\Phrasea\Core::initAutoloads();
chdir(__DIR__);
$finder = new Finder();
$finder
->files()
->name('phraseanet.po')
->in(
array(
__DIR__ . '/locale',
)
)
;
$count = 0;
foreach ($finder as $file)
{
$cmd = sprintf(
'cp %s ./locale/phraseanet-%s.po'
, $file->getRealPath()
, basename(dirname(dirname($file->getRealPath())))
) . PHP_EOL;
system($cmd);
$count++;
}
echo "$count files copied" . PHP_EOL;
exit($count ? 1 : 0);

View File

@@ -22,7 +22,7 @@ var p4 = p4 || {};
};
var phraseaDialog = function (options, level) {
c
var createDialog = function(level) {
var $dialog = $('#' + getId(level));