Closed
Description
Symfony version(s) affected: 4.4 and above
Description
translation:update remove all notes from '+intl-icu' file
How to reproduce
- enable intl extension
- add service:
<?php
declare(strict_types=1);
namespace App\Service;
use Symfony\Contracts\Translation\TranslatorInterface;
final class TestService
{
private TranslatorInterface $translator;
public function __construct(TranslatorInterface $translator)
{
$this->translator = $translator;
}
public function test()
{
$this->translator->trans('Some translated text');
}
}
- enable service in configuration:
services:
App\Service\TestService:
public: true
arguments:
$translator: '@translator'
- update the translation file
./bin/console translation:update ru_RU --force
- add notes to file
messages+intl-icu.ru_RU.xlf
:
<?xml version="1.0" encoding="utf-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" version="1.2">
<file source-language="en" target-language="ru-RU" datatype="plaintext" original="file.ext">
<header>
<tool tool-id="symfony" tool-name="Symfony"/>
</header>
<body>
<trans-unit id="aHhXfmK" resname="Some translated text">
<source>Some translated text</source>
<target>__Some translated text</target>
<note priority="1">Comment for translator</note>
</trans-unit>
</body>
</file>
</xliff>
- update the translation file again
./bin/console translation:update ru_RU --force
- all notes was removed.
Possible Solution
fix method \Symfony\Component\Translation\Catalogue\MergeOperation::processDomain
.