mastodon/app/presenters/language_presenter.rb
2025-01-13 12:58:53 +00:00

17 lines
261 B
Ruby

# frozen_string_literal: true
class LanguagePresenter < ActiveModelSerializers::Model
attributes :code, :name
def initialize(code)
super()
@code = code
@item = LanguagesHelper::SUPPORTED_LOCALES[code]
end
def name
@item[0]
end
end