2019-09-17 21:27:51 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
# Un campo de idioma
|
|
|
|
class MetadataLang < MetadataTemplate
|
|
|
|
def default_value
|
|
|
|
I18n.locale
|
|
|
|
end
|
|
|
|
|
|
|
|
def value
|
2020-02-12 21:24:54 +00:00
|
|
|
self[:value] || document.collection.label || default_value
|
2019-09-17 21:27:51 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def values
|
|
|
|
I18n.available_locales
|
|
|
|
end
|
|
|
|
end
|