Skip to content

Commit

Permalink
After CR
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasOsti committed Sep 18, 2024
1 parent a3d5c4a commit 8dc769e
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/lib/Translation/Extractor/JavaScriptFileVisitor.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,19 @@ public function visitFile(SplFileInfo $file, MessageCatalogue $catalogue)
}

$ast->traverse(function ($node) use ($catalogue, $file) {
if ($this->isMethodCall($node, self::TRANSLATOR_OBJECT, self::TRANSLATOR_TRANS_METHOD) || $this->isMethodCall($node, self::TRANSLATOR_OBJECT, self::TRANSLATOR_TRANS_CHOICE_METHOD)) {
if ($this->isMethodCall($node, self::TRANSLATOR_OBJECT, self::TRANSLATOR_TRANS_METHOD)
|| $this->isMethodCall($node, self::TRANSLATOR_OBJECT, self::TRANSLATOR_TRANS_CHOICE_METHOD)
) {
$arguments = $node->getArguments();
$id = $this->extractId($file, $arguments);
if ($id !== null) {
$callee = $node->getCallee();
$property = $callee->getProperty();

$message = new Message($id, $this->extractDomain($file, $arguments, $property->getName()) ?? $this->defaultDomain);
$message = new Message(
$id,
$this->extractDomain($file, $arguments, $property->getName()) ?? $this->defaultDomain
);
$message->setDesc($this->extractDesc($arguments));
$message->addSource(new FileSource((string)$file));

Expand Down

0 comments on commit 8dc769e

Please sign in to comment.