> ## Documentation Index
> Fetch the complete documentation index at: https://cloudinary.com/documentation/llms.txt
> Use this file to discover all available pages before exploring further.

# Generate multilingual alt text


When you serve images to audiences across different regions and languages, providing alt text in the viewer's language is essential for accessibility and helps screen readers convey meaning accurately. Managing translations manually doesn't scale as your library and markets grow.

This sample PowerFlow automatically translates an asset's primary alt description into multiple languages and saves the results as contextual metadata. You can tailor the target languages to match your localization strategy.

The descriptions are generated when a new image is uploaded to Cloudinary, but you could change this to use a [On Manual Run From Assets](mediaflows_block_reference#on_manual_run_from_assets) block to generate alt text for images that are already in your Media Library.

[Learn more about accessible media](accessible_media#image_accessibility).

> **TIP**:
>
> :title=Prefer to watch than read?
> You can watch the following video tutorials about this automation:

> * Take a look at a [quick overview](mediaflows_multilingual_alt_text_overview_tutorial) of this flow and how it works.

> * Follow along with a [detailed step-by-step walkthrough](mediaflows_multilingual_alt_text_detailed_tutorial).

## Overview

![Multilingual Alt Text PowerFlow](https://cloudinary-res.cloudinary.com/image/upload/bo_2px_solid_gray/f_auto/q_auto/docs/mediaflows/multilingual_alt_text_flow_asset_upload.png "thumb: c_scale,w_700/dpr_2.0, width:700, popup:true")

The PowerFlow uses the following blocks:

* [On Asset Upload](#on_asset_upload): Triggers the flow when an image is uploaded to the product environment.
* [Cloudinary Image Captioning](#cloudinary_image_captioning): Automatically generates a description of the image.
* [Update Contextual Metadata](#update_contextual_metadata_original_language): Saves the original description and translations to the appropriate contextual metadata fields.
* [Google Translate](#google_translate): Translates the description into another language.

## On Asset Upload

When someone uploads an image, Cloudinary sends a webhook notification to the **On Asset Upload** block, which activates the flow.

Steps:

1. Add the **On Asset Upload** block to your canvas.
1. Open the block configuration and set it to trigger only when the **Asset type** is **Image**.

![On Asset Upload configuration](https://cloudinary-res.cloudinary.com/image/upload/bo_1px_solid_gray/f_auto/q_auto/docs/mediaflows/multi_alt_text_on_asset_upload.png "thumb: c_scale,w_600/dpr_2.0, width:600, popup:true")

## Cloudinary Image Captioning

The **Cloudinary Image Captioning** block generates a descriptive caption for the uploaded image using the [Cloudinary AI Content Analysis add-on](cloudinary_ai_content_analysis_addon#ai_based_image_captioning).

> **NOTE**: You must be [registered for the Cloudinary AI Content Analysis add-on](https://console.cloudinary.com/settings/addons) to use this block, which you can do within the block configuration.

Steps:

1. Add the **Cloudinary Image Captioning** block to your canvas and ensure it's connected to the **On Asset Upload** block.
1. Open the block configuration and ensure that the **Use the asset from** field is set to **On Asset Upload**.
1. Ensure you've got quota for the Cloudinary AI Content Analysis add-on.

![Cloudinary Image Captioning configuration](https://cloudinary-res.cloudinary.com/image/upload/bo_1px_solid_gray/f_auto/q_auto/docs/mediaflows/multi_alt_text_captioning_asset_upload.png "thumb: c_scale,w_600/dpr_2.0, width:600, popup:true")

## Update Contextual Metadata (original language)

Use the **Update Contextual Metadata** block to store the generated description in the **alt** contextual metadata field associated with the uploaded asset.

Steps:

1. Add the **Update Contextual Metadata** block to your canvas and ensure it's connected to the **Cloudinary Image Captioning** block.
1. Open the block configuration and set the metadata key to **alt**.
1. Set the **Metadata value** to the **Caption** from the **Cloudinary Image Captioning** block by clicking the `+` icon to insert the variable.
1. Ensure the **Action** is set to **Add or update**.

![Update Contextual Metadata configuration for English](https://cloudinary-res.cloudinary.com/image/upload/bo_1px_solid_gray/f_auto/q_auto/docs/mediaflows/multi_alt_text_context_asset_upload.png "thumb: c_scale,w_600/dpr_2.0, width:600, popup:true")

## Google Translate

The **Google Translate** block translates the image description into whichever language you select. It uses the [Google Translate API](https://cloud.google.com/translate).

> **NOTE**: You must have a Google Cloud project with the Translation API enabled and a valid API key to use this block.

Steps (for each language):

1. Add a **Google Translate** block to your canvas and ensure it's connected to the previous **Update Contextual Metadata** block.
1. Open the block configuration and rename it to match the language that it's translating.
1. Enter your Google API key.
1. Set the **String to translate** to the **Caption** from the **Cloudinary Image Captioning** block by clicking the `+` icon to insert the variable.
1. Let the block automatically detect the language to translate from.
1. Select the language to translate the caption to.

![Google Translate configuration](https://cloudinary-res.cloudinary.com/image/upload/bo_1px_solid_gray/f_auto/q_auto/docs/mediaflows/multi_alt_text_translate_asset_upload.png "thumb: c_scale,w_600/dpr_2.0, width:600, popup:true")

## Update Contextual Metadata (translations)

To store the translations, use additional **Update Contextual Metadata** blocks after each of the [Google Translate](#google_translate) blocks.

Steps (for each language):

1. Add an **Update Contextual Metadata** block to your canvas and ensure it's connected to the relevant **Google Translate** block.
1. Open the block configuration and rename it to match the language that it's storing, e.g, **Update French Contextual Metadata**.
1. Set the metadata key to something appropriate for the language, e.g., **alt-french**.
1. Set the **Metadata value** to the **Translated text** from the relevant **Google Translate** block by clicking the `+` icon to insert the variable.
1. Ensure the **Action** is set to **Add or update**.

![Update Contextual Metadata configuration for French](https://cloudinary-res.cloudinary.com/image/upload/bo_1px_solid_gray/f_auto/q_auto/docs/mediaflows/multi_alt_text_multi_context_asset_upload.png "thumb: c_scale,w_600/dpr_2.0, width:600, popup:true")

## Execute the flow

Save the flow and [test](mediaflows_build_flow#testing_a_flow) it to check it works before enabling it. Once enabled, you can try it out by uploading an image to your product environment.

After executing the flow, you can check that the [contextual metadata](dam_manage_metadata#setting_custom_metadata_values) for the image contains the description and translations:

![Contextual metadata in the Media Library](https://cloudinary-res.cloudinary.com/image/upload/bo_1px_solid_gray/f_auto/q_auto/docs/mediaflows/contextual_metadata_languages.png "thumb: c_scale,w_400/dpr_2.0, width:400, popup:true")

