mirror of
https://github.com/vlucas/valitron.git
synced 2025-12-30 23:01:52 +00:00
fix addRule by merging the loaded language with the current messages
This commit is contained in:
parent
676e80dd8e
commit
cf12d976a6
@ -49,7 +49,8 @@ class Validator
|
||||
// Load language file in directory
|
||||
$langFile = rtrim($langDir, '/') . '/' . $lang . '.php';
|
||||
if ( stream_resolve_include_path($langFile) ) {
|
||||
static::$_ruleMessages = include $langFile;
|
||||
$langMessages = include $langFile;
|
||||
static::$_ruleMessages = array_merge(static::$_ruleMessages, $langMessages);
|
||||
} else {
|
||||
throw new InvalidArgumentException("fail to load language file '$langFile'");
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user