From 8213f23629bfbb5e705ea3fa35bde137751a2c22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Fri, 11 Oct 2024 21:56:53 +0200 Subject: [PATCH] Use I18n texts for image dimensions This way it'll be possible to customize the text in languages not using parenthesis or not using an "x" to define dimensions. --- .../admin/site_customization/images/index_component.rb | 4 +++- config/locales/en/admin.yml | 1 + config/locales/es/admin.yml | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/components/admin/site_customization/images/index_component.rb b/app/components/admin/site_customization/images/index_component.rb index affb8f7f9..41c5b0585 100644 --- a/app/components/admin/site_customization/images/index_component.rb +++ b/app/components/admin/site_customization/images/index_component.rb @@ -20,6 +20,8 @@ class Admin::SiteCustomization::Images::IndexComponent < ApplicationComponent end def image_hint(image) - "(#{image.required_width}x#{image.required_height})" + t("admin.site_customization.images.index.dimensions", + width: image.required_width, + height: image.required_height) end end diff --git a/config/locales/en/admin.yml b/config/locales/en/admin.yml index d07775899..0fc0bd4d3 100644 --- a/config/locales/en/admin.yml +++ b/config/locales/en/admin.yml @@ -1615,6 +1615,7 @@ en: subnavigation_right: Main Navigation Right images: index: + dimensions: "(%{width}x%{height})" title: Custom images update: Update image: Image diff --git a/config/locales/es/admin.yml b/config/locales/es/admin.yml index d2b103454..862836854 100644 --- a/config/locales/es/admin.yml +++ b/config/locales/es/admin.yml @@ -1615,6 +1615,7 @@ es: subnavigation_right: Navegación principal derecha images: index: + dimensions: "(%{width}x%{height})" title: Personalizar imágenes update: Actualizar image: Imagen