Translate extension for MediaWiki
Loading...
Searching...
No Matches
MediaWiki\Extension\Translate\Validation\Validators\PercentEscapeValidator Class Reference

Validates that every % in a translation is followed by a printable ASCII character (0x21–0x7E, i.e. More...

Inheritance diagram for MediaWiki\Extension\Translate\Validation\Validators\PercentEscapeValidator:
MediaWiki\Extension\Translate\Validation\MessageValidator

Public Member Functions

 getIssues (Message $message, string $targetLanguage)

Detailed Description

Validates that every % in a translation is followed by a printable ASCII character (0x21–0x7E, i.e.

excluding space) or another % (i.e. the %% escape sequence). A bare % before a non-ASCII character, a space, a newline, or at end-of-string will cause build failures in projects that use %-based string interpolation. Space (0x20) is intentionally excluded: it is not a valid interpolation specifier in any supported format.

Known limitation: the space flag (e.g. % d) is a valid printf modifier in Python, C/POSIX, and PHP, but is rejected by this validator. This is acceptable because space-flagged conversions are not used in practice in translateable strings. @license GPL-2.0-or-later

Since
2026.09

Definition at line 26 of file PercentEscapeValidator.php.

Member Function Documentation

◆ getIssues()

MediaWiki\Extension\Translate\Validation\Validators\PercentEscapeValidator::getIssues ( Message $message,
string $targetLanguage )

The documentation for this class was generated from the following file: