Skip to content
Permalink
Browse files

Renaming option 'headers' to 'locations'

  • Loading branch information...
wnasich committed Jul 13, 2015
1 parent 67d81e4 commit 06b8cb0c305bb03420e74d8f2f06c44e9e4b2b9f
@@ -49,11 +49,11 @@ class ExtractTask extends AppShell {
protected $_merge = false;
/**
* Add headers for each sentence showing references
* Write lines with locations of each message string
*
* @var bool
*/
protected $_headers = true;
protected $_locations = true;
/**
* Current file being processed
@@ -231,8 +231,8 @@ public function execute() {
$this->_merge = strtolower($response) === 'y';
}
if (isset($this->params['headers'])) {
$this->_headers = !(strtolower($this->params['headers']) === 'no');
if (isset($this->params['locations'])) {
$this->_locations = !(strtolower($this->params['locations']) === 'no');
}
if (empty($this->_files)) {
@@ -327,8 +327,8 @@ public function getOptionParser() {
))->addOption('merge', array(
'help' => __d('cake_console', 'Merge all domain and category strings into the default.po file.'),
'choices' => array('yes', 'no')
))->addOption('headers', array(
'help' => __d('cake_console', 'Add headers for each sentence showing references'),
))->addOption('locations', array(
'help' => __d('cake_console', 'Write lines with locations of each message string'),
'choices' => array('yes', 'no')
))->addOption('output', array(
'help' => __d('cake_console', 'Full path to output directory.')
@@ -587,7 +587,7 @@ protected function _buildFiles() {
foreach ($contexts as $context => $details) {
$plural = $details['msgid_plural'];
$header = '';
if ($this->_headers) {
if ($this->_locations) {
$files = $details['references'];
$occurrences = array();
foreach ($files as $file => $lines) {
@@ -222,18 +222,18 @@ public function testExtractCategory() {
}
/**
* testExtractWithoutHeaders method
* testExtractWithoutLocations method
*
* @return void
*/
public function testExtractWithoutHeaders() {
public function testExtractWithoutLocations() {
$this->Task->interactive = false;
$this->Task->params['paths'] = CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS . 'Pages';
$this->Task->params['output'] = $this->path . DS;
$this->Task->params['extract-core'] = 'no';
$this->Task->params['merge'] = 'no';
$this->Task->params['headers'] = 'no';
$this->Task->params['locations'] = 'no';
$this->Task->expects($this->never())->method('err');
$this->Task->expects($this->any())->method('in')

0 comments on commit 06b8cb0

Please sign in to comment.
You can’t perform that action at this time.