Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Combo items and displayField should be localizable #2886

Closed
pmiklashevych opened this issue May 17, 2021 · 2 comments
Closed

Combo items and displayField should be localizable #2886

pmiklashevych opened this issue May 17, 2021 · 2 comments
Labels
bug Something isn't working forum Issues from forum localization premium

Comments

@pmiklashevych
Copy link

pmiklashevych commented May 17, 2021

https://www.bryntum.com/forum/viewtopic.php?p=86765#p86765

Another request

Scheduler/examples/localization/locales/custom.locale.En.js

    Combo : {
        testLabel : 'my label',
        monthText : 'my month',
        weekText  : 'my week',
        dayText   : 'my day',

Scheduler/examples/localization/app.js


new Scheduler({
    tbar : [
        {
            type  : 'combo',
            label : 'L{testLabel}',
            items : [{
                value : 'monthAndYear',
                text  : 'L{monthText}'
            },
            {
                value : 'weekAndDay',
                text  : 'L{weekText}'
            },
            {
                value : 'dayAndWeek',
                text  : 'L{dayText}'
            }]
        }
    ],

See items are not localized. Select and item. See selected value is not localized.

Workaround:

LocaleManager.on({
    locale() {
        const value = scheduler.widgetMap.myCombo.value;
        scheduler.widgetMap.myCombo.value = null;
        scheduler.widgetMap.myCombo.value = value;
    }
});

new Scheduler({
    tbar : [
        {
            type  : 'combo',
            ref   : 'myCombo',
            label : 'L{testLabel}',
            displayValueRenderer(record, combo) {
                // `this` - Combo
                return record ? this.L(record.text) : '';
            },
            listItemTpl({ text }) {
                // `this` - List
                // `this.owner` - Combo
                return this.owner.L(text);
            },
            items : [{
                value : 'monthAndYear',
                text  : 'L{monthText}'
            },
            {
                value : 'weekAndDay',
                text  : 'L{weekText}'
            },
            {
                value : 'dayAndWeek',
                text  : 'L{dayText}'
            }]
        }
    ],

This might me related: #1429

@pmiklashevych pmiklashevych added bug Something isn't working premium forum Issues from forum localization labels May 17, 2021
@isglass isglass added this to the 4.2.x milestone May 17, 2021
@matsbryntse matsbryntse removed this from the 4.2.x milestone Jun 22, 2021
@chuckn0rris
Copy link

Another request

@JockeLindberg
Copy link

Closing this as it's a duplicate of #1429

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working forum Issues from forum localization premium
Projects
None yet
Development

No branches or pull requests

5 participants