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

Commit9b25573

Browse files
committed
bug#26661 [Translation] XLIFF2: Make sure to trim source if it is too 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
2 parentsf568271 +ca41fec commit9b25573

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

‎src/Symfony/Component/Translation/Dumper/XliffFileDumper.php‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,11 @@ private function dumpXliff2($defaultLocale, MessageCatalogue $messages, $domain,
146146
foreach ($messages->all($domain)as$source =>$target) {
147147
$translation =$dom->createElement('unit');
148148
$translation->setAttribute('id',strtr(substr(base64_encode(hash('sha256',$source,true)),0,7),'/+','._'));
149-
$translation->setAttribute('name',$source);
149+
$name =$source;
150+
if (strlen($source) >80) {
151+
$name =substr(md5($source), -7);
152+
}
153+
$translation->setAttribute('name',$name);
150154
$metadata =$messages->getMetadata($source,$domain);
151155

152156
// Add notes section

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp