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

Parse default option for translation_domain #65

Merged
merged 4 commits into from
Sep 20, 2012

Conversation

bvleur
Copy link
Contributor

@bvleur bvleur commented Jul 30, 2012

As discussed in PR #64 we can parse the default translation_domain from options.

I did not want to add a setDomain to the Message model as that isn't really supported, so I've delayed construction the Message objects until after parsing all the files.

TODO:

  • Display a warning about unsupported parsing of option inheritance when a FormType is added as a child to the builder.
  • for symmertry I propose to move the remainder of the enterNode to a new parseAddCall method.

}

// check if options were passed
// FIXME: Maybe we should throw an exception here? Options are required
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the option resolver not throw an exception here?

General static code analysis is beyond what this bundle can do, I think. It is much more complex :)

I think we can also remove the comment a few lines below.

bvleur added 2 commits August 1, 2012 12:14
…ass.

Add a test for reusing a FormExtractor with and without a translation_domain form option.
Ignore incorrect usage the Form component in the files we scan. In this case: Don't admire to warn when required options are missing or of an unsupported type.
@Venzon
Copy link

Venzon commented Aug 4, 2012

Hi
Can you please tell me what is estimated time when JMSTranslationBundle will support translation_domain option in forms?
This feature will be very useful
Thats for great work with this bundle btw

{
$extractor = $this->createFormExtractor();

$this->testExtractWithDefaultDomain($extractor);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Calling two other test functions here looks a bit weird. Could you refactor this to make the individual tests a bit more independent?

Maybe moving the createFormExtractor method to a setUp method and adding form extractor as a property of this class would help.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can create the setUp method and the class property, but would be calling the two other test functions without parameters be okay?

This is a cleaner way to share the same form extractor.
@travisbot
Copy link

This pull request passes (merged 809327f into ef78903).

@schmittjoh schmittjoh merged commit 809327f into schmittjoh:master Sep 20, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants