File "ValidateLangRule.php"

Full Path: /home/warrior1/public_html/wp-content/plugins/file-manager/backend/app/Http/Rules/ValidateLangRule.php
File size: 428 bytes
MIME-type: text/x-php
Charset: utf-8

<?php

namespace BitApps\FM\Http\Rules;

use BitApps\WPValidator\Rule;
use BitApps\FM\Plugin;

class ValidateLangRule extends Rule
{
    public function validate($value)
    {
        $languages = Plugin::instance()->preferences()->availableLanguages();

        return isset($languages[$value]) ? true : false;
    }

    public function message()
    {
        return __('Language code is not valid', 'file-manager');
    }
}