I18n: add extract_messages_excluded_paths parameter
This commit is contained in:
parent
a3156d4d05
commit
93aeb32660
2 changed files with 11 additions and 4 deletions
|
@ -39,12 +39,15 @@ App::init(
|
||||||
"$root_dir_path/static"
|
"$root_dir_path/static"
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
'default' => array(
|
|
||||||
'upload_max_filesize' => 10485760,
|
|
||||||
'i18n' => array(
|
'i18n' => array(
|
||||||
'default_locale' => "en_US.UTF8",
|
'default_locale' => "en_US.UTF8",
|
||||||
|
'extract_messages_excluded_paths' => array(
|
||||||
|
"static/lib"
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
'default' => array(
|
||||||
|
'upload_max_filesize' => 10485760,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
$root_dir_path
|
$root_dir_path
|
||||||
);
|
);
|
||||||
|
|
|
@ -44,6 +44,7 @@ class I18n {
|
||||||
array(
|
array(
|
||||||
'root_directory' => '${root_directory_path}/locales',
|
'root_directory' => '${root_directory_path}/locales',
|
||||||
'default_locale' => null,
|
'default_locale' => null,
|
||||||
|
'extract_messages_excluded_paths' => [],
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -531,8 +532,11 @@ class I18n {
|
||||||
if (Cli::core_mode() && $static_directory != Tpl::$core_static_directory) continue;
|
if (Cli::core_mode() && $static_directory != Tpl::$core_static_directory) continue;
|
||||||
if (!Cli::core_mode() && $static_directory == Tpl::$core_static_directory) continue;
|
if (!Cli::core_mode() && $static_directory == Tpl::$core_static_directory) continue;
|
||||||
// List JS files to parse
|
// List JS files to parse
|
||||||
|
$cmd = array('find', escapeshellarg(basename($static_directory)), '-name', "'*.js'");
|
||||||
|
foreach (App::get('i18n.extract_messages_excluded_paths', null, 'array') as $path)
|
||||||
|
array_push($cmd, "-not", "-path", "./$path/*");
|
||||||
$result = run_external_command(
|
$result = run_external_command(
|
||||||
array('find', escapeshellarg(basename($static_directory)), '-name', "'*.js'"),
|
$cmd,
|
||||||
null, // no STDIN data
|
null, // no STDIN data
|
||||||
false, // do not escape command args (already done)
|
false, // do not escape command args (already done)
|
||||||
dirname($static_directory) // Run from parent directory
|
dirname($static_directory) // Run from parent directory
|
||||||
|
|
Loading…
Reference in a new issue