5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-15 03:51:41 +00:00

si no hay traducción devolver el nombre del campo

This commit is contained in:
f 2020-06-16 19:23:18 -03:00
parent 91a75b08d0
commit a0c88457cc

View file

@ -23,7 +23,7 @@ class Site
#
# @return String
def t(field)
dig(field.to_s, 'label', I18n.locale.to_s)
dig(field.to_s, 'label', I18n.locale.to_s) || field.to_s
end
end
@ -52,7 +52,7 @@ class Site
# @return Site::Forms::Form
def form(name)
@cached_forms ||= {}
@cached_forms[name] ||= Form[data.dig('forms', name).reject { |k,_| excluded? k }]
@cached_forms[name] ||= Form[data.dig('forms', name).reject { |k, _| excluded? k }]
end
# Detecta si el campo está excluido del formulario final