original_string: 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);
      }
code: 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);
      }
code_tokens: 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 ) ; }
docstring: Get the list of approved locales.
  
  @return Response
  
  @example http://www.example.com/api/locales/
docstring_tokens: Get the list of approved locales .