Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
javiereguiluz merged 1 commit intosymfony:masterfromjaviereguiluz:fix_9287
Feb 21, 2018

Conversation

@javiereguiluz
Copy link
Member

Thisfixes#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 thename 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 😄

@Nyholm
Copy link
Member

That is a super valid comment. Fromsymfony/symfony#25758

For backward compatibility I don't expect to see a change to the way the element is used, but for the 1.2 and 2.0 formats to be treated as equivalent it seems the same logic should be applied.

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 thesource is super long as you describe. To only use the ID is not really preferred. That does not bring any additional value.

Maybe one could improve the name by somehow slugify and shorten thesource into aname?

@javiereguiluz
Copy link
MemberAuthor

javiereguiluz commentedFeb 20, 2018
edited
Loading

I see, it's because of BC compatibility. Thanks! Maybe we could use:substr(md5($source), -7)

@Nyholm
Copy link
Member

I would rather do something like:

$name =$source;if (strlen($source) >80)) {$name =substr(md5($source), -7);// Why "-7" btw?}

@javiereguiluz
Copy link
MemberAuthor

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!

@javiereguiluzjaviereguiluz merged commit30ee49e intosymfony:masterFeb 21, 2018
javiereguiluz added a commit that referenced this pull requestFeb 21, 2018
…luz)This PR was merged into the master branch.Discussion----------Added the name attribute to XLIFF 2 documentsThisfixes#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
symfony-splitter pushed a commit to symfony/translation that referenced this pull requestMar 30, 2018
…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#9302This feature was introduced insymfony/symfony#26149Commits-------ca41fecfd9 Make sure to trim source if it is too long
fabpot added a commit to symfony/symfony that referenced this pull requestMar 30, 2018
…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#9302This feature was introduced in#26149Commits-------ca41fec Make sure to trim source if it is too long
SerhiyMytrovtsiy added a commit to SerhiyMytrovtsiy/translation that referenced this pull requestOct 19, 2022
…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#9302This feature was introduced insymfony/symfony#26149Commits-------ca41fecfd9 Make sure to trim source if it is too long
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Projects

None yet

Milestone

4.1

Development

Successfully merging this pull request may close these issues.

Added support for the "name" attribute in the XLIFF nodes

3 participants

@javiereguiluz@Nyholm@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp