From cf12d976a61159c6190920837f9930b6d9342702 Mon Sep 17 00:00:00 2001 From: Marcos Neves Date: Tue, 20 Aug 2013 22:03:17 -0300 Subject: [PATCH] fix addRule by merging the loaded language with the current messages --- src/Valitron/Validator.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Valitron/Validator.php b/src/Valitron/Validator.php index e25de20..5c324d6 100644 --- a/src/Valitron/Validator.php +++ b/src/Valitron/Validator.php @@ -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'"); }