OFFLINE-GmbH / oc-boxes-support

This repo is used for support requests for the OFFLINE.Boxes plugin
https://boxes.offline.ch
4 stars 0 forks source link

Lost lang variables in Reference box #149

Closed m49n closed 2 months ago

m49n commented 2 months ago

Last version. label and empty value are missing language variables Was:

$widget = new Form($this->controller, (object)[
            'arrayName' => self::PREFIX,
            'model' => $this->model,
            'fields' => [
                'reference_page' => [
                    'type' => 'dropdown',
                    'label' => 'Seite',
                    'emptyOption' => '-- Bitte wählen',
                    'options' => 'OFFLINE\Boxes\FormWidgets\BoxFinder::getPageOptions',
                    'value' => post(self::PREFIX . '.reference_page'),
                    // TODO: This is somehow registered for each Box on the page and results in one request per box.
                    'changeHandler' => 'onReferencePageChange',
                ],
                'reference_box' => [
                    'type' => 'dropdown',
                    'label' => 'Box',
                    'emptyOption' => '-- Bitte wählen',
                    'options' => 'OFFLINE\Boxes\FormWidgets\BoxFinder::getBoxOptions',
                    'trigger' => [
                        'action' => 'hide',
                        'condition' => 'value[]',
                        'field' => 'page',
                    ],
                ],
            ],
        ]);

Become:

$widget = new Form($this->controller, (object)[
            'arrayName' => self::PREFIX,
            'model' => $this->model,
            'fields' => [
                'reference_page' => [
                    'type' => 'dropdown',
                    'label' => Lang::get('offline.boxes::lang.page'),
                    'emptyOption' => Lang::get('offline.boxes::lang.please_select'),
                    'options' => 'OFFLINE\Boxes\FormWidgets\BoxFinder::getPageOptions',
                    'value' => post(self::PREFIX . '.reference_page'),
                    // TODO: This is somehow registered for each Box on the page and results in one request per box.
                    'changeHandler' => 'onReferencePageChange',
                ],
                'reference_box' => [
                    'type' => 'dropdown',
                    'label' => Lang::get('offline.boxes::lang.box'),
                    'emptyOption' => Lang::get('offline.boxes::lang.please_select'),
                    'options' => 'OFFLINE\Boxes\FormWidgets\BoxFinder::getBoxOptions',
                    'trigger' => [
                        'action' => 'hide',
                        'condition' => 'value[]',
                        'field' => 'page',
                    ],
                ],
            ],
        ]);
tobias-kuendig commented 2 months ago

Very strange! According to git these strings were never translated in the first place. Thank you for the hint, this is fixed in v3.6.24.