javascriptextjssencha-architect

Sencha Architect migration translated labels missing


I migrated Sencha Architect v4.X to v5.7 and EXTjs from v5.1 to v7.6.

Labels in the userinterface are displayed only when specified as text: 'Nr.' but not when specified as bind: { text: '{name}'}.

Example in gridview:

columns: [
    {
        xtype: 'gridcolumn',
        width: 70,
        dataIndex: 'number',
        text: 'Nr.',
        filter: {
            type: 'number'
        }
    },
    {
        xtype: 'gridcolumn',
        flex: 1,
        minWidth: 130,
        width: '',
        dataIndex: 'name',
        bind: {
            text: '{name}'
        },
        filter: {
            type: 'string'
        }
    },

My de.json is: "name" : "Name" Executing the command in browser console gives the translated string.

What am i missing here?

Expected no change in language translation behavior.


Solution

  • I have had the same problem. It was a change in regex by Sencha team. The change happened at Extjs 5.1

    Extjs 5.1 (https://docs.sencha.com/extjs/5.1.4/api/src/ViewModel.js.html)

    expressionRe: /^(?:\{[!]?(?:(\d+)|([a-z_][\w\-\.]*))\})$/i,
    

    Extjs 7.6. (https://docs.sencha.com/extjs/7.6.0/classic/src/ViewModel.js.html)

    expressionRe: /^(?:\{(?:(\d+)|([a-z_][\w.]*))\})$/i,
    

    In Extjs 7.6 bindings with "-" are not possible, you may change it to "_" or something else. So instead of text:{your-text} use text:{your_text}

    I dont understand why Sencha did that, it was an anoying experience to fix that...