2023-08-03 12:25:47 +03:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2023-11-10 14:46:00 +02:00
|
|
|
class Api::V1::Instances::LanguagesController < Api::V1::Instances::BaseController
|
2023-08-03 12:25:47 +03:00
|
|
|
skip_around_action :set_locale
|
|
|
|
|
|
|
|
before_action :set_languages
|
|
|
|
|
|
|
|
def show
|
|
|
|
cache_even_if_authenticated!
|
|
|
|
render json: @languages, each_serializer: REST::LanguageSerializer
|
|
|
|
end
|
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
def set_languages
|
|
|
|
@languages = LanguagesHelper::SUPPORTED_LOCALES.keys.map { |code| LanguagePresenter.new(code) }
|
|
|
|
end
|
|
|
|
end
|