microsoft / AL

Home of the Dynamics 365 Business Central AL Language extension for Visual Studio Code. Used to track issues regarding the latest version of the AL compiler and developer tools available in the Visual Studio Code Marketplace or as part of the AL Developer Preview builds for Dynamics 365 Business Central.
MIT License
719 stars 242 forks source link

Caption changes can not be translated from a third App #7690

Closed IceOnly closed 2 months ago

IceOnly commented 3 months ago

1. Describe the bug If an app changed a caption of an exisiting control in a dependend app, this caption change can't be translated with an third App.

2. To Reproduce

  1. Create an App A that adds a Field to the page like the Item Card
  2. Create an App B that change the caption of this new Control of App A
  3. Create an App B - Danish Translation App and place a danish translation of App B in it

3. Expected behavior The controlshould have the danish translation if all three apps are published and danish language is selected

4. Actual behavior The caption has the untranslated caption of App B

5. Versions:

I tried in in the latest sandbox. The oldest Version I tested was BC22.5

Sample code: TranslationIssue.zip

thpeder commented 2 months ago

Hi @IceOnly, The problem is that in the language app are you using the trans-unit ID of the Change, not of the field.

        <trans-unit id="PageExtension 2122701710 - Change 678184728 - Property 2879900210" size-unit="char" translate="yes" xml:space="preserve" al-object-target="Page 1434786627">
          <source>Test Field App B</source>
          <target state="translated">DK - Testfelt App B</target>
          <note from="Developer" annotates="general" priority="2"/>
          <note from="Xliff Generator" annotates="general" priority="3">PageExtension ItemCardExtB - Change TestField - Property Caption</note>
        </trans-unit>

------>

        <trans-unit id="PageExtension 209611859 - Control 678184728 - Property 2879900210" size-unit="char" translate="yes" xml:space="preserve" al-object-target="Page 1434786627">
          <source>Test Field App A</source>
          <note from="Developer" annotates="general" priority="2"></note>
          <note from="Xliff Generator" annotates="general" priority="3">PageExtension ItemCardExtA - Control TestField - Property Caption</note>
        </trans-unit>
IceOnly commented 2 months ago

Hi @thpeder, and how can you automate the whole thing? Why does the translation file work if it is part of App B? The translator needs to translate the source of the change, not of the orginal fieldcaption.

So the Trans Unit ID is already wrong in App B? Then there is an error in the compiler after all.