~cytrogen/masto-fe

ref: d7254bd3327c5ad208b7f74aade749234441b3bc masto-fe/app/presenters/language_presenter.rb -rw-r--r-- 313 bytes
d7254bd3 — Laura Hausmann Update default local-settings 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