Message per status kind or error code. */ public static function all(): array { $messages = array( 'idle' => '', 'loading' => __( 'Looking the address up…', 'cepis-woocommerce' ), 'found' => __( 'Address found.', 'cepis-woocommerce' ), 'not_found' => __( 'CEP not found. Check the number or fill the address in by hand.', 'cepis-woocommerce' ), /* translators: 1: municipality, e.g. Areal. 2: state code, e.g. RJ. 3: lowest CEP that exists there, e.g. 25845-001. 4: highest CEP that exists there, e.g. 25849-899. */ 'not_found_range' => __( 'CEP not found. This number would be in %1$s/%2$s, which has CEPs from %3$s to %4$s. Check the number.', 'cepis-woocommerce' ), /* translators: 1: municipality, e.g. Areal. 2: state code, e.g. RJ. */ 'not_found_city' => __( 'CEP not found. This number would be in %1$s/%2$s. Check the number.', 'cepis-woocommerce' ), 'invalid' => __( 'Invalid CEP. Type all 8 digits.', 'cepis-woocommerce' ), 'rate_limited' => __( 'Too many lookups in a short time. Wait a few seconds and try again.', 'cepis-woocommerce' ), 'server' => __( 'The CEP service is unavailable. Fill the address in by hand.', 'cepis-woocommerce' ), 'network' => __( 'Could not look the CEP up. Check your connection and try again.', 'cepis-woocommerce' ), 'timeout' => __( 'The CEP lookup took too long. Try again or fill the address in by hand.', 'cepis-woocommerce' ), 'invalid_response' => __( 'Unexpected answer from the CEP service. Fill the address in by hand.', 'cepis-woocommerce' ), ); /** * Filters the messages shown at the checkout while a CEP is resolved. * * @param array $messages Message per status kind or error code. */ $messages = (array) apply_filters( 'cepis_woocommerce_messages', $messages ); $clean = array(); foreach ( $messages as $key => $message ) { if ( is_string( $key ) && is_scalar( $message ) ) { $clean[ sanitize_key( $key ) ] = wp_strip_all_tags( (string) $message ); } } return $clean; } }