What happens if the custom id is not unique?

You need to define custom ids as unique. If you use the same id for two different text messages then only the first one is extracted. But its translation is used in place of both original text messages.

For example, let's define same custom id myCustomId for two messages,

<h2 i18n="@@myCustomId">Good morning</h3>
<!-- ... -->
<h2 i18n="@@myCustomId">Good night</p>

and the translation unit generated for first text in for German language as

<trans-unit id="myId" datatype="html">
<source>Good morning</source>
<target state="new">Guten Morgen</target>

Since custom id is the same, both of the elements in the translation contain the same text as below

<h2>Guten Morgen</h2>
<h2>Guten Morgen</h2>

August 04, 2022