/**
         * @param $data
         *
         * @return bool
         */
        private static function validate_data($data)
        {
            $data_is_valid = true;
            if (self::get_basket() && self::get_source_language()) {
                /*we do not add items that are not in the source language of the current basket
                		we cannot yet set its source language though since update_basket would set the basket
                		to false as long as we do not have any elements in the basket*/
                if (self::$translate_from != self::get_source_language()) {
                    self::$messages[] = array('type' => 'update', 'text' => __('You cannot add posts in this language to the basket since it already contains posts or strings of another source language!
						Either submit the current basket and then add the post or delete the posts of differing language in the current basket', 'wpml-translation-management'));
                    self::update_basket();
                    $data_is_valid = false;
                }
            }
            // no language selected ?
            if (!isset(self::$translation_action) || empty(self::$translation_action)) {
                self::$messages[] = array('type' => 'error', 'text' => __('Please select at least one language to translate into.', 'wpml-translation-management'));
                self::$dashboard_select = $data;
                // pre fill dashboard
                $data_is_valid = false;
            }
            if ($data_is_valid) {
                $data_is_valid = false;
                $basket_items_types = self::get_basket_items_types();
                // nothing selected ?
                foreach ($basket_items_types as $basket_items_type => $basket_type) {
                    if (isset($data[$basket_items_type]) && $data[$basket_items_type]) {
                        $data_is_valid = true;
                        break;
                    }
                }
            }
            if (!$data_is_valid) {
                self::$messages[] = array('type' => 'error', 'text' => __('Please select at least one document to translate.', 'wpml-translation-management'));
                self::$dashboard_select = $data;
                // pre-populate dashboard
                $data_is_valid = false;
                return $data_is_valid;
            }
            return $data_is_valid;
        }