-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Added the name attribute to XLIFF 2 documents #9302
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
That is a super valid comment. From symfony/symfony#25758
So my answer is simply just: "but we do it in 1.2, that is why I do it in 2.0". Im not sure what the reasoning were back when 1.2 was made. Im also not sure what would be a good value if the Maybe one could improve the name by somehow slugify and shorten the |
I see, it's because of BC compatibility. Thanks! Maybe we could use: |
I would rather do something like: $name = $source;
if (strlen($source) > 80)) {
$name = substr(md5($source), -7); // Why "-7" btw?
} |
The |
Let's merge this "as is" and if we need to change anything in the code, let's discuss about that in a separate issue. Thanks! |
…luz) This PR was merged into the master branch. Discussion ---------- Added the name attribute to XLIFF 2 documents This fixes #9287. It's a simple fix because we only display one XLIFF 2 document in the docs. ----- @Nyholm I'm sure you did the right thing ... but just asking: making the `name` value the same as `source` is the best possible solution here? In Symfony's code the `source` attribute is short (https://github.com/symfony/symfony/pull/26149/files) but in real world it can be super long and super ugly (containing `CDATA`, etc.) So, don't you think this will be very verbose? Could we make the `name` value the same as the `id` attribute instead? If the XLIFF standard forces us to do this, then forget my comment and accept my apologies 😄 Commits ------- 30ee49e Added the name attribute to XLIFF 2 documents
…o long for "name" (Nyholm) This PR was merged into the 4.1-dev branch. Discussion ---------- [Translation] XLIFF2: Make sure to trim source if it is too long for "name" | Q | A | ------------- | --- | Branch? | master | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | | License | MIT | Doc PR | This PR is a follow-up on @javiereguiluz's comment here: symfony/symfony-docs#9302 This feature was introduced in symfony/symfony#26149 Commits ------- ca41fecfd9 Make sure to trim source if it is too long
…o long for "name" (Nyholm) This PR was merged into the 4.1-dev branch. Discussion ---------- [Translation] XLIFF2: Make sure to trim source if it is too long for "name" | Q | A | ------------- | --- | Branch? | master | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | | License | MIT | Doc PR | This PR is a follow-up on @javiereguiluz's comment here: symfony/symfony-docs#9302 This feature was introduced in #26149 Commits ------- ca41fec Make sure to trim source if it is too long
…o long for "name" (Nyholm) This PR was merged into the 4.1-dev branch. Discussion ---------- [Translation] XLIFF2: Make sure to trim source if it is too long for "name" | Q | A | ------------- | --- | Branch? | master | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | | License | MIT | Doc PR | This PR is a follow-up on @javiereguiluz's comment here: symfony/symfony-docs#9302 This feature was introduced in symfony/symfony#26149 Commits ------- ca41fecfd9 Make sure to trim source if it is too long
This fixes #9287. It's a simple fix because we only display one XLIFF 2 document in the docs.
@Nyholm I'm sure you did the right thing ... but just asking: making the
name
value the same assource
is the best possible solution here? In Symfony's code thesource
attribute is short (https://github.com/symfony/symfony/pull/26149/files) but in real world it can be super long and super ugly (containingCDATA
, etc.) So, don't you think this will be very verbose? Could we make thename
value the same as theid
attribute instead? If the XLIFF standard forces us to do this, then forget my comment and accept my apologies 😄