From 6063f8dc6b012ec03f4b534eab86b480b9672a4e Mon Sep 17 00:00:00 2001 From: maki Date: Mon, 1 Jul 2024 15:47:36 -0300 Subject: [PATCH] fix: idioma por defecto #15068 --- app/helpers/application_helper.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 7d1f9c0b..baef3b05 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -156,8 +156,8 @@ module ApplicationHelper private def post_t(*attribute, post:, type:) - post.layout.metadata.dig(*attribute, type.to_s, I18n.locale.to_s) || - post.layout.metadata.dig(*attribute, type.to_s, I18n.default_locale.to_s) || - I18n.t("posts.attributes.#{attribute.join('.')}.#{type}") + post.layout.metadata.dig(*attribute, type.to_s, I18n.locale.to_s).presence || + post.layout.metadata.dig(*attribute, type.to_s, post.site.default_locale.to_s).presence || + I18n.t("posts.attributes.#{attribute.join('.')}.#{type}").presence end end