How can I prevent the creation of duplicate assets during language translation? | Community
Skip to main content
Akash3131
October 16, 2024
Solved

How can I prevent the creation of duplicate assets during language translation?

  • October 16, 2024
  • 1 reply
  • 478 views

For example, if there is an image authored on the English page stored at "/content/dam/project/asset/image.png," when I run the translation job for the Spanish page, it creates a new folder "/content/dam/project/es/asset/image.png."

This leads to an increase in size and the overall package size, which needs to be moved in a higher Environment.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by SureshDhulipudi

Generally the translation step in AEM creates separate folders for assets in each language to maintain a clear separation of content for different locales. This approach ensures that each language version of the site has its own set of assets, which can be independently managed and localized.

Different languages may require different versions of the same asset (e.g., images with text, meta info, localized graphics).

However, if the assets are identical across languages and do not require localization, you can customize the translation workflow to reuse existing assets instead of creating duplicates. This can be achieved by implementing a custom handler - TranslationAssetHandler class.

The TranslationAssetHandler class is designed to prevent the creation of duplicate assets during the translation process in Adobe Experience Manager (AEM). It ensures that if an asset already exists in the target language folder, it reuses the existing asset instead of creating a new one. This helps in reducing the overall package size and avoids unnecessary duplication of asset.

Please check TranslationAssetHandler class and handleTranslation method to customize.

handleTranslation(String sourcePagePath, String targetPagePath)

 

 

1 reply

SureshDhulipudi
Community Advisor
SureshDhulipudiCommunity AdvisorAccepted solution
Community Advisor
October 16, 2024

Generally the translation step in AEM creates separate folders for assets in each language to maintain a clear separation of content for different locales. This approach ensures that each language version of the site has its own set of assets, which can be independently managed and localized.

Different languages may require different versions of the same asset (e.g., images with text, meta info, localized graphics).

However, if the assets are identical across languages and do not require localization, you can customize the translation workflow to reuse existing assets instead of creating duplicates. This can be achieved by implementing a custom handler - TranslationAssetHandler class.

The TranslationAssetHandler class is designed to prevent the creation of duplicate assets during the translation process in Adobe Experience Manager (AEM). It ensures that if an asset already exists in the target language folder, it reuses the existing asset instead of creating a new one. This helps in reducing the overall package size and avoids unnecessary duplication of asset.

Please check TranslationAssetHandler class and handleTranslation method to customize.

handleTranslation(String sourcePagePath, String targetPagePath)