Language Copy - Custom component translation | Community
Skip to main content
New Participant
June 26, 2023
Solved

Language Copy - Custom component translation

  • June 26, 2023
  • 2 replies
  • 996 views

Hi Team,

 

We are trying to create a Language copy for a site that's in the English Language. When a Spanish copy is created it isn't translating Custom Components and I have seen documentation to configure translation rules for each of the custom components and choose the properties that we would like to get translated in the `Translation Configuration` module. Since we have bunch of custom components, I was thinking if there's a way that we could define at a single place once and it's all taken care of when authors create any number of pages.

 

Looking for suggestions as to how it can be a one-time task on all custom components so authors don't have to worry about creating translation configuration while adding a new custom component each time. Thanks in advance.

 

-Manasa

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 Shiv_Prakash_Patel

Hi @manasabojja7,

You are looking to update the Translation configuration as one-time task. So you can update the translation_rules.xml file.

File location in crx/de - /conf/global/settings/translation/rules/translation_rules.xml

Node Properties can be update by modifiying resourceType, name etc.

<node resourceType="/apps/learning/components/accordion"> <property inherit="true" name="aemTitle" translate="true" updateDestinationLanguage="false"/> </node>

I hope this can help you !!!

Regards

Shiv

 

2 replies

aanchal-sikka
New Participant
June 27, 2023

Hello @manasabojja7 

 

In addition to @shiv_prakash_patel suggestion, please check with your Translation Vendor as well.

 

Sometimes, they have their own separate configurations to define the components and regex for translatable properties

Aanchal Sikka
Shiv_Prakash_Patel
Shiv_Prakash_PatelAccepted solution
New Participant
June 27, 2023

Hi @manasabojja7,

You are looking to update the Translation configuration as one-time task. So you can update the translation_rules.xml file.

File location in crx/de - /conf/global/settings/translation/rules/translation_rules.xml

Node Properties can be update by modifiying resourceType, name etc.

<node resourceType="/apps/learning/components/accordion"> <property inherit="true" name="aemTitle" translate="true" updateDestinationLanguage="false"/> </node>

I hope this can help you !!!

Regards

Shiv

 

Shiv Prakash
New Participant
June 27, 2023

Thanks for your response @shiv_prakash_patel 

 

Is that the only way to go and update /conf/global/settings/translation/rules/translation_rules.xml anytime a new custom component is added? 

Let's say we developed a custom component and pushed the code. Now the authors go and author the pages with this new component. It would be an additional manual task to be remembered to go and update this XML. Instead, is there a way that we could handle these translation attributes/config while developing the component itself? I'm not sure if this is even possible but just wanted to check