public function setTextDomain($textdomain, $path) { // full path to localization messages $full_path = app_path() . DIRECTORY_SEPARATOR . $path; // sanity check - path must exist relative to app/ folder if (!File::isDirectory($full_path)) { $this->createFolder($path); } // bind text domain bindtextdomain($textdomain, $full_path); // set text domain textdomain($textdomain); // allow object chaining return $this; }