-
Notifications
You must be signed in to change notification settings - Fork 292
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
Feature/extract concat strings #379
base: master
Are you sure you want to change the base?
Conversation
This is replacing #336 I'm not sure about the part "It only adds the ability to handle concatenated strings to regular php files. Is it not possible to support this with other files like the form extractor?" I haven't used that feature but I can add the fix there too, I would need some details though on where to add the fix, is it only affecting FormExtractor class? Or it should be added in other places too? |
@@ -216,7 +216,7 @@ public function extract() | |||
if (false !== $pos = strrpos($file, '.')) { | |||
$extension = substr($file, $pos + 1); | |||
|
|||
if ('php' === $extension) { | |||
if ('php' === $extension or 'phtml' === $extension) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this needed?
I like this PR, I only had some questions |
if ($node instanceof String_) { | ||
return $node->value; | ||
} else { | ||
return self::concatToString($node->left) . self::concatToString($node->right); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why a static call?
ping @murhafh, you still looking to get this merged? |
Description
Just added a small change so in case you have a long concatenated strings in your code, you can use the bundle to extract those strings into your translation files. It basically converts the concatenated strings into one string before passing it to extraction.
Todos