~cytrogen/masto-fe

ref: effe4728cf7adbefd9becf927cf4a34e3b337eb2 masto-fe/app/presenters/language_presenter.rb -rw-r--r-- 313 bytes
effe4728 — github-actions[bot] New Crowdin Translations (automated) (#27005) 2 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# frozen_string_literal: true

class LanguagePresenter < ActiveModelSerializers::Model
  attributes :code, :name, :native_name

  def initialize(code)
    super()

    @code = code
    @item = LanguagesHelper::SUPPORTED_LOCALES[code]
  end

  def name
    @item[0]
  end

  def native_name
    @item[1]
  end
end