data; $content = '
' . strval(trans('firefly.route_has_no_help')) . '
'; if (!$help->hasRoute($route)) { Log::error('No such route: ' . $route); return Response::json($content); } if ($help->inCache($route, $language)) { $content = $help->getFromCache($route, $language); Log::debug(sprintf('Help text %s was in cache.', $language)); return Response::json($content); } $content = $help->getFromGithub($route, $language); $notYourLanguage = '' . strval(trans('firefly.help_may_not_be_your_language')) . '
'; // get backup language content (try English): if (strlen($content) === 0) { $language = 'en_US'; if ($help->inCache($route, $language)) { Log::debug(sprintf('Help text %s was in cache.', $language)); $content = $notYourLanguage . $help->getFromCache($route, $language); } if (!$help->inCache($route, $language)) { $content = trim($notYourLanguage . $help->getFromGithub($route, $language)); } } if ($content === $notYourLanguage) { $content = '' . strval(trans('firefly.route_has_no_help')) . '
'; } $help->putInCache($route, $language, $content); return Response::json($content); } }