-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Translation] added <tool> element metadata to XliffFileDumper #15225
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
Conversation
timwhitlock
commented
Jul 7, 2015
Q | A |
---|---|
Bug fix? | no |
New feature? | no |
BC breaks? | no |
Deprecations? | no |
Tests pass? | yes |
Fixed tickets | #15190 |
License | MIT |
Doc PR |
'tool-id' => 'symfony', | ||
'tool-name' => get_class($this), | ||
); | ||
$this->toolMeta = array_merge( $required, $meta ); |
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.
i would remove the spaces
i like your PR, but can you explain a little bit for what this is useful? |
* | ||
* @param array attributes supported by the <tool> element | ||
*/ | ||
protected function setToolMetadata( array $meta ){ |
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 making it protected ? IT should be private IMO
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.
@OskarStark The purpose is for translation software when presented with a file to know that Symfony generated it. Knowing this means the software can process it differently to how it might by default. I could elaborate on that, but in general if a file format provides a generator declaration, I see no reason not to use it. Also other projects using the Translation component may have their own requirement for declaring themselves.
@stof making the method private is fine for the Symfony case, but I was under the impression that Components were supposed to be portable. As shown in the test case, a supposed XliffExtendedFileDumper
sets its own tool signature, hence why I made it protected.
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.
@timwhitlock we start with marking methods private and only open them if someone with a good use case asks for it.
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.
@timwhitlock making things protected is generally the worse extension point ever (it hurts maintenance a lot because we need to maintain BC on them). It is better to design proper extension point where needed than allowing to hack into the internal logic by exposing it. Inheritance is most of the time not the proper extension point.
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.
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.
As per my initial comment I thought the maintainers would prefer to decide on best practice. I'm not experienced in contributing to Symfony, as evidenced by this discussion. If anyone maintaining the Translation component is interested in implementing this properly then great. Either way, feel free to close my PR. I'm afraid I don't have the time to rework it.
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.
@timwhitlock no worry, we are here to work together :)
@timwhitlock Can you finish this PR? |
As I said above, I don't have time to rework. I'd close, but unsure of protocol. |
I can work on it next week |
closed in favor of #15551 |