blob: 53bc591fb5381a1dacb5645131ab6632d48b6643 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
<?php
declare( strict_types = 1 );
namespace MediaWiki\Extension\Translate\Validation\Validators;
use MediaWiki\Extension\Translate\Validation\MessageValidator;
use MediaWiki\Extension\Translate\Validation\ValidationIssue;
use MediaWiki\Extension\Translate\Validation\ValidationIssues;
use TMessage;
class NotEmptyValidator implements MessageValidator {
public function getIssues( TMessage $message, string $targetLanguage ): ValidationIssues {
$translation = $message->translation();
$issues = new ValidationIssues();
if ( $translation !== null && trim( $translation ) === '' ) {
$issues->add(
new ValidationIssue(
'empty',
'empty',
'translate-checks-empty'
)
);
}
return $issues;
}
}
|