I'm creating an extension where I display some static text as a field on a page. The reason for this is that the actual content of the field in the record should not be directly visible to or editable by the user. Instead, I'm showing a custom page where the user selects values and these are stored in the actual field of the record. The definition for this field looks like this:
field(MyExtCategories; CategoriesLinkText())
{
ApplicationArea = All;
Caption = 'Categories';
ToolTip = 'Edit the item''s categories';
trigger OnDrillDown()
begin
// Let the user pick some categories
end;
}
As you can see, the "value" for the field is the result of a call to the CategoriesLinkText() procedure, which is defined like this:
var
NoneSelectedTxt: Label 'None (click to edit)';
SomeSelectedTxt: Label 'Selected (click to edit)';
local procedure CategoriesLinkText(): Text
begin
if StrLen("Categories".Trim()) > 0 then
exit(SomeSelectedTxt)
else
exit(NoneSelectedTxt);
end;
Obvously this code simply checks whether the user already selected some categories and returns the respective text. So far, so good, this works as required.
However, now I've added a German translation and of course I've also translated the two Labels above, but in the Web Client, the texts are still in English, while everything else is in German. Of course I could modify these labels so be language independent, but I wonder: how would I return the translated text from the procedure instead of the original untranslated text?
UPDATE
I just noticed that the same problem occurs when showing an Error message. The text, while translated, is shown in English.
UPDATE II
Aaaaand again I feel like an idiot: Instead of specifying de-DE for my translated file, I had only specified de as the target language. Setting it to de-DE shows my translated strings...

Report
All responses (
Answers (