Automatically translate referenced CFs | Community
Skip to main content
daniel-strmecki
Community Advisor and Adobe Champion
Community Advisor and Adobe Champion
February 18, 2025
Solved

Automatically translate referenced CFs

  • February 18, 2025
  • 3 replies
  • 847 views

Hello,

 

I am using Language Wire for translations and I wanted my custom references to CFs to be automatically translated. Therefore I added the following config to translation_rules.xml with a property name and resource type to a custom component.

<assetNode assetReferenceAttribute="contactList" checkInChildNodes="false" createLangCopy="true" resourceType="my-project/components/content/components/group-contacts/v1/group-contacts"/>

The component resource type matches and the property contactList contains a string linking to a CF (/content/dam.../my-cf).

However, this doesn't seem to be working and my referenced CF doesn't great translated. What am I missing?

 

 

BR,

Daniel

Best answer by AmitVishwakarma

Hi  @daniel-strmecki ,

It looks like you're on the right track, but there are a few things you might want to double-check:
1. Property Name: Ensure that the property name contactList in your component exactly matches the assetReferenceAttribute in the translation_rules.xml. Even a small mismatch can prevent the translation from happening.
2. Resource Type: Confirm that the resourceType in your translation rules precisely matches the full path of your component (/apps/my-project/components/content/components/group-contacts/v1/group-contacts). Any discrepancy here could cause the rule to not be applied.

3. File Location: Make sure that your translation_rules.xml file is placed in the correct location under /conf/<your-language>/settings/wcm/translation.
4. Logs: If the issue persists, check the AEM logs for any errors or warnings related to translation rules or asset handling. These can often provide clues about what's going wrong.
5. Asset Translation: Double-check if the content fragment (/content/dam.../my-cf) is properly configured for translation. If assets like CFs aren't configured correctly in translation settings, they may not get translated automatically.

 

3 replies

ManviSharma
Adobe Employee
Adobe Employee
February 18, 2025

Hello Daniel,


Could  you please check if translation_rules.xml file is correctly configured. The assetReferenceAttribute should match the property name in your component that contains the CF reference. In your case, it is contactList.

- Also, the resourceType should precisely match the path of your component. 

Additionally, could you please confirm what do you observe in logs while experiencing the issue ?

daniel-strmecki
Community Advisor and Adobe Champion
Community Advisor and Adobe Champion
February 19, 2025

Hi @manvisharma,

I see no errors or warnings while running a translation project. The resourceType matches the resourceType of the component containing the contactList property.

 

BR,

Daniel

AmitVishwakarma
Community Advisor
AmitVishwakarmaCommunity AdvisorAccepted solution
Community Advisor
February 18, 2025

Hi  @daniel-strmecki ,

It looks like you're on the right track, but there are a few things you might want to double-check:
1. Property Name: Ensure that the property name contactList in your component exactly matches the assetReferenceAttribute in the translation_rules.xml. Even a small mismatch can prevent the translation from happening.
2. Resource Type: Confirm that the resourceType in your translation rules precisely matches the full path of your component (/apps/my-project/components/content/components/group-contacts/v1/group-contacts). Any discrepancy here could cause the rule to not be applied.

3. File Location: Make sure that your translation_rules.xml file is placed in the correct location under /conf/<your-language>/settings/wcm/translation.
4. Logs: If the issue persists, check the AEM logs for any errors or warnings related to translation rules or asset handling. These can often provide clues about what's going wrong.
5. Asset Translation: Double-check if the content fragment (/content/dam.../my-cf) is properly configured for translation. If assets like CFs aren't configured correctly in translation settings, they may not get translated automatically.

 

daniel-strmecki
Community Advisor and Adobe Champion
Community Advisor and Adobe Champion
February 19, 2025

Hi @amitvishwakarma,

thanks for the hints:

1) Checked, the property name is exactly the same

2) Checked, but will try to add /apps prefix

3) Checked, even tried adding the config trough UI, same result

4) No errors were observed in the logs

5) Can you please elaborate on this one? What additional configuration is required for CFs?

 

BR,

Daniel

daniel-strmecki
Community Advisor and Adobe Champion
Community Advisor and Adobe Champion
February 26, 2025

Update: I still haven't figured this one, I don't think my config is wrong, maybe it's just not working with Language Wire, will need to check with them.

kautuk_sahni
Community Manager
Community Manager
March 5, 2025

@1562045 you find the suggestion helpful? Please let us know if you need more information. If a response worked, kindly mark it as correct for posterity; alternatively, if you found a solution yourself, we’d appreciate it if you could share it with the community. Thank you!

Kautuk Sahni