public function getLocales()
    {
        $this->start();
        try {
            $this->getUserControl()->checkRateLimit();
            $this->getUserControl()->checkGenericAccess(__FUNCTION__);
            $locales = $this->app->make(LocaleRepository::class)->getApprovedLocales();
            $result = $this->buildJsonResponse($this->localesToArray($locales));
        } catch (Exception $x) {
            $result = $this->buildErrorResponse($x);
        } catch (Throwable $x) {
            $result = $this->buildErrorResponse($x);
        }

        return $this->finish($result);
    }