Пример #1
0
 public function testCreationForAllLanguages()
 {
     $c = new Config($this->container);
     $p = new Project($this->container);
     foreach ($c->getLanguages() as $locale => $language) {
         Translator::load($locale);
         $this->assertNotFalse($p->create(array('name' => 'UnitTest ' . $locale)), 'Unable to create project with ' . $locale . ':' . $language);
     }
     Translator::unload();
 }
Пример #2
0
 /**
  * Send notification to someone
  *
  * @access public
  * @param  array     $user        User
  * @param  string    $event_name
  * @param  array     $event_data
  */
 public function sendUserNotification(array $user, $event_name, array $event_data)
 {
     Translator::unload();
     // Use the user language otherwise use the application language (do not use the session language)
     if (!empty($user['language'])) {
         Translator::load($user['language']);
     } else {
         Translator::load($this->config->get('application_language', 'en_US'));
     }
     foreach ($this->notificationType->getUserSelectedTypes($user['id']) as $type) {
         $className = strtolower($type) . 'Notification';
         $this->{$className}->send($user, $event_name, $event_data);
     }
 }