file_bulkupload_translations-1.0.x-dev/src/Plugin/Validation/Constraint/EnabledLanguageConstraint.php
src/Plugin/Validation/Constraint/EnabledLanguageConstraint.php
<?php
declare(strict_types=1);
namespace Drupal\file_bulkupload_translations\Plugin\Validation\Constraint;
use Symfony\Component\Validator\Constraint as SymfonyConstraint;
/**
* @Annotation
*/
#[Constraint(
id : "EnabledLanguage",
label : new TranslatableMarkup("Not possible to create a translation of not existing language", [], ['context' => 'Validation']),
type : 'file'
)]
class EnabledLanguageConstraint extends SymfonyConstraint {
/**
* The message shown when the language_filename is invalid.
*
* @var string
*/
public const INVALID_LANGUAGE = 'The language suffix "%language_filename" in the filename is not valid or enabled on your Drupal site.';
}
