public function missingKey($namespace, $group, $key, $locale = null, $useLottery = false, $findOrNew = false)
{
if (!$useLottery || $this->config(self::LOG_MISSING_KEYS_KEY)) {
// Fucking L5 changes
$group = self::fixGroup($group);
$group = $namespace && $namespace !== '*' ? $namespace . '::' . $group : $group;
if (!in_array($group, $this->config(self::EXCLUDE_GROUPS_KEY))) {
$lottery = 1;
if ($useLottery && $this->config(self::MISSING_KEYS_LOTTERY_KEY) !== 1) {
$lottery = \Session::get($this->config(self::PERSISTENT_PREFIX_KEY) . self::LOTTERY_PERSISTENT_SUFFIX, '');
if ($lottery === '') {
$lottery = rand(1, $this->config(self::MISSING_KEYS_LOTTERY_KEY));
\Session::put($this->config(self::PERSISTENT_PREFIX_KEY) . self::LOTTERY_PERSISTENT_SUFFIX, $lottery);
}
}
if ($lottery === 1) {
// here need to map a local group to wbn: or vnd: package if the local file does not already exist so that
// new keys will be added to the appropriate package
$augmentedGroupList = $this->getGroupAugmentedList();
if (array_key_exists($group, $augmentedGroupList)) {
$group = $augmentedGroupList[$group];
}
$locale = $locale ?: $this->app['config']['app.locale'];
if ($findOrNew) {
$translation = $this->firstOrNewTranslation(array('locale' => $locale, 'group' => $group, 'key' => $key));
} else {
$translation = $this->firstOrCreateTranslation(array('locale' => $locale, 'group' => $group, 'key' => $key));
}
return $translation;
}
}
}
return null;
}