DanielNT / ALTranslationCenter

Extension for improving speed in multilanguage developing with AL Language.
0 stars 0 forks source link

ToolTips in Table/TableExt don't seem to regenerate correctly #14

Closed JavierFuentes closed 3 months ago

JavierFuentes commented 3 months ago

With AL runtime 13.0 we can set Field ToolTips at the Table/TableExt level.

The ATC Generate xlif from source action seems to not regenerate the translation files properly when the ToolTip is completely removed from the field at the table level and the existing entry up to that moment disappears from the .g.Xlif file.

You can see the result here:

image

DanielNT commented 3 months ago

Hi @JavierFuentes, thanks for reporting.

Are you developing a new extension? If that is the case, the problem could be that the source .g.xlf does not include any languages in developer notes after remove the tooltip translation, so it does not recreate the files es-ES.g.xlf and _es-EStradnl.g.xlf, and the translations remains the same.

JavierFuentes commented 3 months ago

Hi @DanielNT , yes, it's a new AL extension with runtime 13.0...

I hope you can reproduce this case playing with Git staging like this example...

table 50000 "Garantia"
{
    Caption = 'Garantía', Locked = true;
    DataClassification = CustomerContent;

    fields
    {
        field(1; "Código"; Code[10])
        {
            Caption = 'Código', Locked = true;
            // ToolTip = 'Código', Comment = 'ESP="ESTO ES UNA PRUEBA"';  // After you disable this line to move to the page, the translations are not removed from the files
        }
    }

    keys { key(Key1; "Código") { Clustered = true; } }
}

Before : with ToolTip property at Table/TableExt level with Comment and execute ATC action....

image

After: without ToolTip property at Table/TableExt level and execute ATC action...

image

DanielNT commented 3 months ago

Thanks for the complete example and pictures @JavierFuentes. Maybe I did not explain well the problem in english, so I will write more detailed in spanish below.


Creo que lo que sucede es que en ese código, al borrar el tooltip (pero podría ser cualquier otra propiedad que tenga en el Comment un idioma, por eso comentaba que es casi seguro que no tiene que ver por ser Runtime 13), como acabas de empezar la extensión y no hay ninguna traducción más, no se genera ningún archivo de traducción, pero tampoco elimina los existentes (segunda foto), porque actualmente solo se recrean los archivos de traducción en los cuales SÍ haya al menos una traducción (que es lo que ocurría en la primera foto, cuando tenías el Tooltip activo).

Se podría pensar si forzar el borrado de todo el contenido de la carpeta Translations, aunque eso podría tener implicaciones para otros usuarios de la extensión, quizás sería necesario crear una opción nueva.

Puedes comprobar a borrar los archivos de traducción (dejando el .g.xlf original) y ejecutar el comando, entiendo que no debería generarte nada. También debería ocurrir lo mismo si primero lo generas con un Tooltip traducido en una page -por poner un ejemplo- (siendo la única traducción), ejecutas el comando, y lo quitas, quedando sin textos traducidos. Al volver a ejecutar el comando por segunda vez debería ocurrir exactamente tu misma situación.

Un saludo.

JavierFuentes commented 3 months ago

Hi @DanielNT , I think you're absolutely right.

Everything works as expected when at least 1 translation exists in the AL extension using the Comment property.

Thank you for the detailed explanation in Spanish, our native language.


Gracias por la explicación tan detallada en español, nuestro idioma materno.