qooxdoo-compiler icon indicating copy to clipboard operation
qooxdoo-compiler copied to clipboard

this alias aren't resolved in some syntaxes

Open rommni opened this issue 4 years ago • 0 comments

Some code of our team using a particular way to declare some "mini class" inside of a qooxdoo class.

qx.Class.define("myProject.MyClass",
{   
    extend: qx.ui.container.Composite,

    include : [qx.locale.MTranslation],

    construct: function () {
        this.SortOfClass = new this.__CreateSortOfClass(this, someArguments);
    }

    members: {
        __CreateSortOfClass(pThis, someArguments) {
            let that = pThis;
            // Some initialization
            let someTrad = that.tr("MyStringToTranslate");
        }
    }
}

In this particular case the qx.tool.compiler.ClassFile.js doesn't recognize that as a thisAliases and so it can be a problem for example for translations, because the "MyStringToTranslate" isn't recognize as a translation Id used so isn't added to qx.$$translations and so the tr return the Id instead of the translated string.

I recognize that it is a very particular use case and for the moment we found a fix by using "writeAllTranslations" : true in compile.json, however I don't know if it can cause other problems and if one of you want to have a look and have a solution it would be very pleasant for us ;)

rommni avatar Aug 28 '20 09:08 rommni