-
Notifications
You must be signed in to change notification settings - Fork 293
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
Position of @Desc in PHP #16
Comments
It could be implemented, but it might be a bit more complicated than the current implementation. Feel free to write up a patch though. |
Ok... I'll take a look at the code if I can spare some time. Other things which came up: Similar to the above the position of @desc for form labels would be nice as <?php
'label' => 'form.field.label', /** @Desc My Label */
?> but this prolly doesn't make much sense as the annotation would be after the element an not before? Second one: |
Could you open a separate issue for the choice values possibly with an On Tue, Dec 20, 2011 at 6:10 PM, Matthias Althaus <
|
Created #17 for this. |
I've also bumped on this today. And did a failing testcase first as I thought it's a bug. Here is the diff for it. --- a/lib/vendor/bundles/JMS/TranslationBundle/Tests/Translation/Extractor/File/DefaultPhpFileExtractorTest.php
+++ b/lib/vendor/bundles/JMS/TranslationBundle/Tests/Translation/Extractor/File/DefaultPhpFileExtractorTest.php
@@ -58,6 +58,11 @@ class DefaultPhpFileExtractorTest extends BasePhpFileExtractorTest
$message->addSource(new FileSource($path, 76));
$expected->add($message);
+ $message = new Message('text.var.assign');
+ $message->setDesc('The var %foo% should be assigned.');
+ $message->addSource(new FileSource($path, 82));
+ $expected->add($message);
+
$this->assertEquals($expected, $catalogue);
} --- a/lib/vendor/bundles/JMS/TranslationBundle/Tests/Translation/Extractor/File/Fixture/Controller.php
+++ b/lib/vendor/bundles/JMS/TranslationBundle/Tests/Translation/Extractor/File/Fixture/Controller.php
@@ -75,4 +75,10 @@ class Controller
{
$arr['foo']->trans('text.array_method_call');
}
-}
\ No newline at end of file
+
+ public function assignToVar()
+ {
+ /** @Desc("The var %foo% should be assigned.") */
+ $err = $this->translator->trans('text.var.assign', array('%foo%' => 'fooVar'));
+ }
+} |
Hey,
would it be hard to support the following positioning:
This doesn't get extracted, but I would prefer to not put the annotation before the service call as this uglifies the code.
Could this be implemented or is this somehow limited by the parser?
Cheers
Matthias
The text was updated successfully, but these errors were encountered: