Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for multiple extensions to same target introduce the translations bug #7790

Open
zabcik opened this issue Jul 9, 2024 · 7 comments

Comments

@zabcik
Copy link

zabcik commented Jul 9, 2024

1. Describe the bug

When using multiple table extensions to same table then translations does not work correctly.
Only first table extension is translated.

It is probably due to bad "trans-unit id" in XLF file.

2. To Reproduce

Steps to reproduce the behavior:

  1. Go to 'AL: Go' - Create new project "ALProject".
  2. Add feature "TranslationFile" in manifest file app.json.
  3. Copy source code bellow.
  4. Compile project.
  5. Create translation file "ALProject.cs-CZ.xlf" (target-language="cs-CZ") and translate all.
  6. Publish project.
  7. See page Customers and last columns - there are not translated fields...
namespace DefaultNamespace;

using Microsoft.Sales.Customer;

tableextension 50101 CustomerExt1 extends Customer
{
    fields
    {
        field(50001; "Welcome Message 1"; Text[50])
        {
            Caption = 'Welcome Message 1';
        }
    }
}

tableextension 50102 CustomerExt2 extends Customer
{
    fields
    {
        field(50002; "Welcome Message 2"; Text[50])
        {
            Caption = 'Welcome Message 2';
        }
    }
}

pageextension 50101 CustomerList extends "Customer List"
{
    layout
    {
        addlast(Control1)
        {
            field("Welcome Message 1"; Rec."Welcome Message 1")
            {
                ApplicationArea = All;
                ToolTip = 'Specifies the value of the Welcome Message 1 field.';
            }
            field("Welcome Message 2"; Rec."Welcome Message 2")
            {
                ApplicationArea = All;
                ToolTip = 'Specifies the value of the Welcome Message 2 field.';
            }
        }
    }
}
<?xml version="1.0" encoding="UTF-8"?>
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
  <file datatype="xml" source-language="en-US" target-language="cs-CZ" original="ALProject5">
    <body>
      <group id="body">
        <trans-unit id="PageExtension 363045002 - Control 1245603148 - Property 1295455071" size-unit="char" translate="yes" xml:space="preserve" al-object-target="Page 2901867346">
          <source>Specifies the value of the Welcome Message 1 field.</source>
          <target state="translated">Ur??uje hodnotu pole Uv??tac?? zpr??va 1.</target>
          <note from="Developer" annotates="general" priority="2"></note>
          <note from="Xliff Generator" annotates="general" priority="3">PageExtension CustomerList - Control Welcome Message 1 - Property ToolTip</note>
        </trans-unit>
        <trans-unit id="PageExtension 363045002 - Control 1883299765 - Property 1295455071" size-unit="char" translate="yes" xml:space="preserve" al-object-target="Page 2901867346">
          <source>Specifies the value of the Welcome Message 2 field.</source>
          <target state="translated">Ur??uje hodnotu pole Uv??tac?? zpr??va 2.</target>
          <note from="Developer" annotates="general" priority="2"></note>
          <note from="Xliff Generator" annotates="general" priority="3">PageExtension CustomerList - Control Welcome Message 2 - Property ToolTip</note>
        </trans-unit>
        <trans-unit id="TableExtension 3520207680 - Field 1245603148 - Property 2879900210" size-unit="char" translate="yes" xml:space="preserve" al-object-target="Table 1994964448">
          <source>Welcome Message 1</source>
          <target state="translated">Uv??tac?? zpr??va 1</target>
          <note from="Developer" annotates="general" priority="2"></note>
          <note from="Xliff Generator" annotates="general" priority="3">TableExtension CustomerExt1 - Field Welcome Message 1 - Property Caption</note>
        </trans-unit>
        <trans-unit id="TableExtension 3520207680 - Field 1883299765 - Property 2879900210" size-unit="char" translate="yes" xml:space="preserve" al-object-target="Table 1994964448">
          <source>Welcome Message 2</source>
          <target state="translated">Uv??tac?? zpr??va 2</target>
          <note from="Developer" annotates="general" priority="2"></note>
          <note from="Xliff Generator" annotates="general" priority="3">TableExtension CustomerExt2 - Field Welcome Message 2 - Property Caption</note>
        </trans-unit>
      </group>
    </body>
  </file>
</xliff>

image

image

3. Expected behavior

The all fields from all table extension are translated.

4. Actual behavior

Only fields from first table extension are translated.

5. Versions:

  • AL Language: v14.0.1070882 (pre-release)
  • Visual Studio Code: 1.91.0
  • Business Central: 24.3
    Internal work item: AB#541532
@NKarolak
Copy link

Thanks for bringing this also to my attention - I am currently splitting my objects, and only now I'm seeing that I'm affected as well. It also affects page extensions. The first page extension caption changes are considered, the second page extension (in my case for an action) is not.

@BazookaMusic Losing translations is a major issue for every AppSource developer. It would be good to give this issue some higher priority.

@BazookaMusic
Copy link

I'll accept this as it's clearly a bug across compiler and runtime and has direct customer impact

@ChrisBlankDe
Copy link

ChrisBlankDe commented Jul 10, 2024

Microsoft does not fully follow the xliff standard when creating the *.g.xlf we use to copy.
The original attribute in the file node should contain a file name, not the app name.
If you reference the g file in the node both translations will be shown.

-  <file datatype="xml" source-language="en-US" target-language="de-DE" original="Awesome App" tool-id="MultilingualAppToolkit" product-name="n/a" product-version="n/a" build-num="n/a">
+  <file datatype="xml" source-language="en-US" target-language="de-DE" original="Awesome App.g.xlf" tool-id="MultilingualAppToolkit" product-name="n/a" product-version="n/a" build-num="n/a">

Colleagues created a support request a view weeks ago in may '24.

@mkilinskidev
Copy link

mkilinskidev commented Sep 3, 2024

Any progress in this case? I've noticed that the g file is corrupted, not only translation file.
image

@NKarolak
Copy link

NKarolak commented Sep 5, 2024

@BazookaMusic Can you give an update, please?
I've just received my first customer support ticket due to that issue, and there are more to come ...

@BazookaMusic
Copy link

@thpeder is working on this so I'll let him provide any updates on the progress of this one

@thloke
Copy link
Contributor

thloke commented Sep 10, 2024

I can give an update since I actually worked on this recently. This has turned out to be a much bigger issue than we first expected.

Our plan now is to fix this in BC 24/25 (it is a server side fix) in a minimally disruptive way, the fixes have been merged so I expect the servers to be hotfixed in the next few weeks.

But in BC26 onwards, we're rethinking how we do translation keys for extension objects. We haven't fully settled on the solution yet, but it's likely that there will be some changes in BC26 for extension object translation keys across the board.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants