Closed cristof-thomas closed 2 months ago
Hi @cristof-thomas,
I just tried out the code that you have in the issue description, and it does not reproduce for me. This is the generated translation file.
<trans-unit id="Codeunit 2605812460 - Method 2186843627 - NamedType 1006928925" size-unit="char" translate="yes" xml:space="preserve">
<source>label1</source>
<note from="Developer" annotates="general" priority="2"></note>
<note from="Xliff Generator" annotates="general" priority="3">Codeunit my_codeunit - Method p1 - NamedType lbl1</note>
</trans-unit>
<trans-unit id="Codeunit 2605812460 - Method 4099933478 - NamedType 1006928925" size-unit="char" translate="yes" xml:space="preserve">
<source>label2</source>
<note from="Developer" annotates="general" priority="2"></note>
<note from="Xliff Generator" annotates="general" priority="3">Codeunit my_codeunit - Method p2 - NamedType lbl1</note>
</trans-unit>
That being said, the Ids of a trans-unit is a hash of the names involved, which means that there can occur collisions. We have therefor included multiple elements to help avoid that situation. For instance in the example above. Codeunit my_codeunit - Method p2 - NamedType lbl1
If you encounter such diagnostic the best recommendation I have for you is to rename the local variable inside the procedure
Please include the following with each issue:
1. Describe the bug error AL0570: Same label var name in same codeunit results in same translation ID
2. To Reproduce codeunit 1234 my_codeunit { procedure p1() var lbl1: Label 'label1'; begin end;
procedure p2() var lbl1: Label 'label2'; begin end; }
...\my_codeunit.al(y1,x1): error AL0570: The symbol 'lbl1' results in the same translation ID as one or more other symbols. Rename symbol to resolve the problem. ...\my_codeunit.al(y2,x2): error AL0570: The symbol 'lbl1' results in the same translation ID as one or more other symbols. Rename symbol to resolve the problem.
Note: Because the developers need to copy and paste the code snippet, including a code snippet as a media file (i.e. .gif) is not sufficient.
3. Expected behavior 2 differents translation ID generated
4. Actual behavior error with same translation ID
5. Versions:
Final Checklist
Please remember to do the following:
[X] Search the issue repository to ensure you are reporting a new issue
[X] Reproduce the issue after disabling all extensions except the AL Language extension
[X] Simplify your code around the issue to better isolate the problem