Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PhpFileExtractor: Add $defaultDomain variable instead of hard coded #427

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

### 1.3.1 to UNRELEASED

* DefaultPhpFileExtractor can be extended to define domain where should be extracted messages.

### 1.3.0 to 1.3.1

* Fixed new messages not showing at the top in WebUI when in XLIFF format.
Expand Down
7 changes: 6 additions & 1 deletion Translation/Extractor/File/DefaultPhpFileExtractor.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,11 @@ class DefaultPhpFileExtractor implements LoggerAwareInterface, FileVisitorInterf
'transchoice' => 3,
);

/**
* @var string
*/
protected $defaultDomain = 'messages';

/**
* DefaultPhpFileExtractor constructor.
* @param DocParser $docParser
Expand Down Expand Up @@ -176,7 +181,7 @@ public function enterNode(Node $node)

$domain = $node->args[$index]->value->value;
} else {
$domain = 'messages';
$domain = $this->defaultDomain;
}

$message = new Message($id, $domain);
Expand Down