Support for multiple extensions to same target introduce the translations bug
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:
- Go to 'AL: Go' - Create new project "ALProject".
- Add feature "TranslationFile" in manifest file app.json.
- Copy source code bellow.
- Compile project.
- Create translation file "ALProject.cs-CZ.xlf" (target-language="cs-CZ") and translate all.
- Publish project.
- 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>
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
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.
I'll accept this as it's clearly a bug across compiler and runtime and has direct customer impact
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.
Any progress in this case? I've noticed that the g file is corrupted, not only translation file.
@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 ...
@thpeder is working on this so I'll let him provide any updates on the progress of this one
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.
@thloke Could you update us on this topic, please?
I'm glad you asked for an update. This fell into an unfortunate state. We fixed it in BC24/25, but then the proper long-term fix didn't make the cut for BC26 in our backlog so it would have regressed in BC26 onwards....
I'm going to make the same server side fix for BC26 (and onwards) as well as the long term fix with changing how we do translation keys doesn't look like it'll make our backlog anytime soon.
@thloke Thank you for the response. Do you have an estimation when this will be available on customer environments? Is this also an OnPremise issue? does this mean that BC26 RTM is unusable if you have languages other than EN-US?
@thloke,
that long-term fix you are mentioning in BC26, how it will affect current translation files? We are preparing the translation for the base and system apps of the BC for our country, and it would be a great issue if we would need to process 800.000 lines of translation again.
@thloke Thank you for the response. Do you have an estimation when this will be available on customer environments? Is this also an OnPremise issue? does this mean that BC26 RTM is unusable if you have languages other than EN-US?
This will probably be in 26.2 for OnPrem.
that long-term fix you are mentioning in BC26, how it will affect current translation files? We are preparing the translation for the base and system apps of the BC for our country, and it would be a great issue if we would need to process 800.000 lines of translation again.
The long term fix will probably not be implemented any time soon, when/if we do get around to it, we will maintain backwards compatibility with existing translation files.
@thloke Thank you for the estimation for OnPrem, this is indeed bad news again But what with SaaS? How long have I tell my customer to wait to upgrade to BC26? Why isn't there any statement that the upgrade should be postponed? I get daily complains from customers who try the newest Version and complain about missing translations.
@thloke Thank you for the estimation for OnPrem, this is indeed bad news again But what with SaaS? How long have I tell my customer to wait to upgrade to BC26? Why isn't there any statement that the upgrade should be postponed? I get daily complains from customers who try the newest Version and complain about missing translations.
We're backporting the fix today, which means BC26 clusters will be hotfixed in the coming weeks. I can't say exactly when the hotfix will be rolled out since that depends on multiple factors.
@thloke Thank you for the estimation for OnPrem, this is indeed bad news again But what with SaaS? How long have I tell my customer to wait to upgrade to BC26? Why isn't there any statement that the upgrade should be postponed? I get daily complains from customers who try the newest Version and complain about missing translations.
We're backporting the fix today, which means BC26 clusters will be hotfixed in the coming weeks. I can't say exactly when the hotfix will be rolled out since that depends on multiple factors.
Thank you for the estimation
@thloke I was in contact with microsoft support where it was stated that the fix should be part of platform version 26.0.33212.0, I checked today on (Plattform 26.0.33270.0 + Anwendung 26.0.30643.33009) BC SaaS and there are missing translations in the base application, was the build a mistake? Is there more than only the platform build?
@thloke I was in contact with microsoft support where it was stated that the fix should be part of platform version 26.0.33212.0, I checked today on (Plattform 26.0.33270.0 + Anwendung 26.0.30643.33009) BC SaaS and there are missing translations in the base application, was the build a mistake? Is there more than only the platform build?
No, that should be correct. Let me check why it's still showing untranslated items.
@thloke I got a response from my support contact which worked for me on my support case on this matter, there he stated that this will be part of BC 26.1. Unfortunately.
@thloke I got a response from my support contact which worked for me on my support case on this matter, there he stated that this will be part of BC 26.1. Unfortunately.
That doesn't sound correct. The fix is in the server, so as long as the server is running a version equal to or greater than the version with the fix (26.0.33270.0) it should not matter which minor release the environment is running. We're looking into this.
The only area where the minor release makes sense is if you're running OnPrem, but in that case the platform version would be older than the one with the fix.
@thloke I got a response from my support contact which worked for me on my support case on this matter, there he stated that this will be part of BC 26.1. Unfortunately.
That doesn't sound correct. The fix is in the server, so as long as the server is running a version equal to or greater than the version with the fix (26.0.33270.0) it should not matter which minor release the environment is running. We're looking into this.
The only area where the minor release makes sense is if you're running OnPrem, but in that case the platform version would be older than the one with the fix.
Now I wanted to provide you with a fresh screenshot but I am seeing now all captions in the correct language. A different Application Version but same platform (Plattform 26.0.33270.0 + Anwendung 26.0.30643.33284)
I checked the translation files between the 2 build, no difference, maybe it was a caching problem in browser?
But now it seems to work! I am sorry for the inconvience, but I have no clue why there are different infos, shouldn't it be clear if it is working or not?
It could definitely be a caching issue in the browser or even one on the server, but I'm glad that it works! Thanks for double checking, that saved us some investigation time.
In theory when the new version of the platform rolls out in SaaS, the server instances get restarted so there shouldn't be any caching of translation results, but there could be some interplay with a stale cache in the browser (but this is entering pure speculation from me now).
I'm going to close this issue as well, but feel free to keep pinging me here if anything else crops up and I can reopen.