Added support for name on the unit node
This commit is contained in:
parent
65b2bcde1b
commit
30a22aaf7f
@ -6,6 +6,7 @@ CHANGELOG
|
|||||||
|
|
||||||
* The `FileDumper::setBackup()` method is deprecated and will be removed in 5.0.
|
* The `FileDumper::setBackup()` method is deprecated and will be removed in 5.0.
|
||||||
* The `TranslationWriter::disableBackup()` method is deprecated and will be removed in 5.0.
|
* The `TranslationWriter::disableBackup()` method is deprecated and will be removed in 5.0.
|
||||||
|
* The `XliffFileDumper` will write "name" on the "unit" node when dumping XLIFF 2.0.
|
||||||
|
|
||||||
4.0.0
|
4.0.0
|
||||||
-----
|
-----
|
||||||
|
@ -146,6 +146,7 @@ class XliffFileDumper extends FileDumper
|
|||||||
foreach ($messages->all($domain) as $source => $target) {
|
foreach ($messages->all($domain) as $source => $target) {
|
||||||
$translation = $dom->createElement('unit');
|
$translation = $dom->createElement('unit');
|
||||||
$translation->setAttribute('id', strtr(substr(base64_encode(hash('sha256', $source, true)), 0, 7), '/+', '._'));
|
$translation->setAttribute('id', strtr(substr(base64_encode(hash('sha256', $source, true)), 0, 7), '/+', '._'));
|
||||||
|
$translation->setAttribute('name', $source);
|
||||||
$metadata = $messages->getMetadata($source, $domain);
|
$metadata = $messages->getMetadata($source, $domain);
|
||||||
|
|
||||||
// Add notes section
|
// Add notes section
|
||||||
|
@ -1,19 +1,19 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<xliff xmlns="urn:oasis:names:tc:xliff:document:2.0" version="2.0" srcLang="fr-FR" trgLang="en-US">
|
<xliff xmlns="urn:oasis:names:tc:xliff:document:2.0" version="2.0" srcLang="fr-FR" trgLang="en-US">
|
||||||
<file id="messages.en_US">
|
<file id="messages.en_US">
|
||||||
<unit id="LCa0a2j">
|
<unit id="LCa0a2j" name="foo">
|
||||||
<segment>
|
<segment>
|
||||||
<source>foo</source>
|
<source>foo</source>
|
||||||
<target>bar</target>
|
<target>bar</target>
|
||||||
</segment>
|
</segment>
|
||||||
</unit>
|
</unit>
|
||||||
<unit id="LHDhK3o">
|
<unit id="LHDhK3o" name="key">
|
||||||
<segment>
|
<segment>
|
||||||
<source>key</source>
|
<source>key</source>
|
||||||
<target order="1"></target>
|
<target order="1"></target>
|
||||||
</segment>
|
</segment>
|
||||||
</unit>
|
</unit>
|
||||||
<unit id="2DA_bnh">
|
<unit id="2DA_bnh" name="key.with.cdata">
|
||||||
<segment>
|
<segment>
|
||||||
<source>key.with.cdata</source>
|
<source>key.with.cdata</source>
|
||||||
<target><![CDATA[<source> & <target>]]></target>
|
<target><![CDATA[<source> & <target>]]></target>
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<xliff xmlns="urn:oasis:names:tc:xliff:document:2.0" version="2.0" srcLang="fr-FR" trgLang="en-US">
|
<xliff xmlns="urn:oasis:names:tc:xliff:document:2.0" version="2.0" srcLang="fr-FR" trgLang="en-US">
|
||||||
<file id="messages.en_US">
|
<file id="messages.en_US">
|
||||||
<unit id="LCa0a2j">
|
<unit id="LCa0a2j" name="foo">
|
||||||
<notes>
|
<notes>
|
||||||
<note category="state">new</note>
|
<note category="state">new</note>
|
||||||
<note category="approved">true</note>
|
<note category="approved">true</note>
|
||||||
@ -12,7 +12,7 @@
|
|||||||
<target>bar</target>
|
<target>bar</target>
|
||||||
</segment>
|
</segment>
|
||||||
</unit>
|
</unit>
|
||||||
<unit id="uqWglk0">
|
<unit id="uqWglk0" name="baz">
|
||||||
<notes>
|
<notes>
|
||||||
<note id="x">x_content</note>
|
<note id="x">x_content</note>
|
||||||
<note appliesTo="target" category="quality">Fuzzy</note>
|
<note appliesTo="target" category="quality">Fuzzy</note>
|
||||||
|
Reference in New Issue
Block a user