@@ -134,7 +134,7 @@ abstract class Ardent extends Model {
134134 protected static $ externalValidator = false ;
135135
136136 /**
137- * A Translator instance, to be used by standalone Ardent instances.
137+ * A Validation Factory instance, to be used by standalone Ardent instances with the Translator .
138138 *
139139 * @var \Illuminate\Validation\Factory
140140 */
@@ -484,7 +484,7 @@ public function getAttribute($key) {
484484 * @param array $connection Connection info used by {@link \Illuminate\Database\Capsule\Manager::addConnection}.
485485 * Should contain driver, host, port, database, username, password, charset and collation.
486486 */
487- public static function configureAsExternal (array $ connection ) {
487+ public static function configureAsExternal (array $ connection, $ lang = ' en ' ) {
488488 $ db = new DatabaseCapsule ;
489489 $ db ->addConnection ($ connection );
490490 $ db ->setEventDispatcher (new Dispatcher (new Container ));
@@ -495,11 +495,11 @@ public static function configureAsExternal(array $connection) {
495495
496496 $ db ->bootEloquent ();
497497
498- $ translator = new Translator (' en ' );
498+ $ translator = new Translator ($ lang );
499499 $ translator ->addLoader ('file_loader ' , new PhpFileLoader ());
500500 $ translator ->addResource ('file_loader ' ,
501- dirname (__FILE__ ).DIRECTORY_SEPARATOR .'.. ' .DIRECTORY_SEPARATOR .'lang ' .DIRECTORY_SEPARATOR .' en ' .
502- DIRECTORY_SEPARATOR .'validation.php ' , ' en ' );
501+ dirname (__FILE__ ).DIRECTORY_SEPARATOR .'.. ' .DIRECTORY_SEPARATOR .'lang ' .DIRECTORY_SEPARATOR .$ lang .
502+ DIRECTORY_SEPARATOR .'validation.php ' , $ lang );
503503
504504 self ::$ externalValidator = true ;
505505 self ::$ validationFactory = new ValidationFactory ($ translator );
0 commit comments