mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-13 13:03:20 +00:00
Merge branch '3.6' of github.com:alchemy-fr/Phraseanet into 3.6
This commit is contained in:
@@ -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')
|
||||
|
@@ -45,6 +45,7 @@ $finder
|
||||
->notName(basename(__FILE__))
|
||||
->exclude('.git')
|
||||
->exclude('vendor')
|
||||
->exclude('Doctrine/Proxies')
|
||||
;
|
||||
|
||||
$count = 0;
|
||||
|
66
launchpadToLocales.php
Executable file
66
launchpadToLocales.php
Executable 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);
|
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
47
localesToLaunchPad.php
Executable file
47
localesToLaunchPad.php
Executable 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);
|
@@ -22,7 +22,7 @@ var p4 = p4 || {};
|
||||
};
|
||||
|
||||
var phraseaDialog = function (options, level) {
|
||||
c
|
||||
|
||||
var createDialog = function(level) {
|
||||
|
||||
var $dialog = $('#' + getId(level));
|
||||
|
Reference in New Issue
Block a user