Add ability to translate server rules (#34494)
This commit is contained in:
parent
977164decc
commit
8c51a8ba94
17 changed files with 149 additions and 20 deletions
|
@ -1,9 +1,15 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class REST::RuleSerializer < ActiveModel::Serializer
|
||||
attributes :id, :text, :hint
|
||||
attributes :id, :text, :hint, :translations
|
||||
|
||||
def id
|
||||
object.id.to_s
|
||||
end
|
||||
|
||||
def translations
|
||||
object.translations.to_h do |translation|
|
||||
[translation.language, { text: translation.text, hint: translation.hint }]
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue