Help displaying Image alt text on a product gallery image

Hi, I would like to use the product image Alt text to display a caption over the product image.

Here is the code I have in my product-images.liquid file

{{product.title}} - {{image.alt}}

The product title is being displayed perfectly, but I can not seem to get the alt tag to display. I tried a number of other placeholder objects, with some working, and others not.

Can someone enlighten me on what I may be doing wrong? Am i missing something crucial to make this work?

I will post the full page code below…

Thanks for your help!!!


{%- assign featured_media = product.selected_or_first_available_variant.featured_media | default: product.featured_media -%}

{%- unless product.empty? -%}

{%- for media in product.media -%} {%- include 'media', media: media, featured_media: featured_media, isModal: isModal, video_looping: video_looping, video_style: video_style -%} {%- endfor -%}

{% assign first_3d_model = product.media | where: ‘media_type’, ‘model’ | first %}

{%- if first_3d_model -%}
<button
aria-label=“{{ ‘products.product.view_in_space_label’ | t }}”
class=“product-single__view-in-space”
data-shopify-xr
data-shopify-model3d-id=“{{ first_3d_model.id }}”
data-shopify-title=“{{ product.title }}”
data-shopify-xr-hidden



{{ ‘products.product.view_in_space’ | t }}


{%- endif -%}

**
{{product.title}} - {{image.alt}}
**

{%- else -%}

{%- endunless -%}

try adding | t to the img alt.

{{ image.alt | t }}

https://shopify.dev/tutorials/develop-theme-localization-use-translation-keys

Unfortunately this didnt work.

I know I’m answering this quite late but for anyone who still might struggle with this or runs across this question, try using {{media.alt}} instead of {{image.alt}}. Hope it helps :))