language_values[ (string) $value ] = true; } return $value; } /** * Wrap a remembered value so Weglot does not translate it again. * * @param string $output Escaped output. * @param mixed $value Resolved value. * @param string $type Variable type. * @param array $context Resolution context. * @return string */ public function mark( $output, $value, $type, $context ) { $source = is_array( $context ) ? (string) ( $context['source'] ?? '' ) : ''; if ( '' === (string) $output || ! in_array( $type, array( 'text', 'multiline', 'number' ), true ) || ! ( in_array( $source, array( 'shortcode', 'block' ), true ) || 0 === strpos( $source, 'token_' ) ) || ! is_scalar( $value ) || ! isset( $this->language_values[ (string) $value ] ) || ! self::active() ) { return $output; } return '' . $output . ''; } }