-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[2.1][TwigBridge] trans_default_domain fails in blocks #6747
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
Comments
From what I know the trans_default_domain applies to whole file not just one block. |
No, it's working fine in other circumstances, it can be contained in a block. |
This PR was squashed before being merged into the 2.1 branch (closes #7281). Commits ------- e3547c6 [TwigBridge] fixes Discussion ---------- [TwigBridge] fixes `TranslationDefaultDomainNodeVisitor` ... by adding scope management. | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #6747 --------------------------------------------------------------------------- by vicb at 2013-03-06T15:14:57Z Are `open` and `close` good names ? I would prefer `addChild` and `getParent` as there is nothing that is really opened or closed ? Edit: by looking at the code a second time, I think open & close make sense . --------------------------------------------------------------------------- by jfsimon at 2013-03-07T13:46:13Z @vicb I know this is not consistent with the rest of the framework. I dont think @fabpot will like them. --------------------------------------------------------------------------- by stof at 2013-03-07T13:53:14Z what about enter and leave ? It would be consistent with the naming used for scopes in the DI component --------------------------------------------------------------------------- by vicb at 2013-03-07T13:59:35Z @stof I like your proposal. My main concern being "leave" (former "close"), @jfsimon could you throw when a scope is used after it has been left ? --------------------------------------------------------------------------- by jfsimon at 2013-03-07T14:01:56Z go for enter/leave, but why throwing an exception on using a leaved scope? --------------------------------------------------------------------------- by vicb at 2013-03-07T14:05:22Z because if you have a ref to a left scope, you can still use it which is bad
This may be related, wondering if anyone has any clues on it My template (which is included via include) has this statement (below) in it and this throws the same kind of internal var does not exist error. Seems the trigger is
@havvg any ideas as to why? |
@rdohms the |
@stof that makes sense. Does this work as you woudl expect it to?
|
This would probably work, yes (except that |
@stof it seems to be the only value that triggers the desired behaviour, which is, ignore this tag if nothing is set. Empty string is a valid domain so its breaks, and setting to "messages" is a bit too hardcoded to be safe. So it seems at least to my tests that setting it to null will make the tag not have any effect. Thnks! |
hmm, actually, |
@stof, yes but it triggers the intended behaviour, which is "use the Rafael Machado Dohms Developer, Evangelist, Gamer On Wed, Dec 11, 2013 at 11:05 AM, Christophe Coevoet <
|
When using
{% trans_default_domain %}
in a block, it beaks if there are other blocks defined afterwards. The error message readsThis one breaks:
while this one is just fine:
The text was updated successfully, but these errors were encountered: