Project specific translation_rules.xml | Community
Skip to main content
New Participant
June 27, 2023
Solved

Project specific translation_rules.xml

  • June 27, 2023
  • 1 reply
  • 1085 views

Hello Everyone!

We have multiple sites running in the same instance. Each site has several custom components and they are totally different in nature. Instead of going and adding each component in Translation Configuration UI, is it possible to have a translation_rules.xml file for a specific site? If so, is it possible to manage the translation_rules.xml file through the maven project that way rules will be applied/available as soon as we build and deploy the specific maven project?

Based on what I read in different articles looks like the translation_rules.xml file resides in the below locations but haven't found any article that talks about a project-specific translation_rules.xml file.

  • /libs/settings/translation/rules/translation_rules.xml
  • /apps/settings/translation/rules/translation_rules.xml
  • /conf/global/settings/translation/rules/translation_rules.xml

Open to any other suggestions as well.

Thank you!

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 salamswapnil

@webdev91 

I am not sure if AEM or maven has any straight forward solution to this issue. 

One probable solution I can think of is You can create a one more maven project dedicated for translation rules file and all teams utilize it for their respective changes and remove translation rules file from all other projects.

1 reply

New Participant
June 27, 2023

Hi @webdev91 

You can not have multiple translation_rules.xml files. There is only one translation_rules.xml file per aem instance. You can create different contexts under this file for your each site like below I have created for wknd site. You can add components specific to that site under this context.

Node in xml will look like this.

 

<?xml version="1.0" encoding="UTF-8"?><nodelist> <node path="/content/wknd"> <node resourceType="wknd/components/accordion"> <property inherit="true" name="xyz" translate="true" updateDestinationLanguage="false"/> </node> </node> </nodelist>

 

To make translation_rules.xml as part of your maven build, you need to put it under /conf/global/settings/translation/rules.

 

Thanks

Swapnil

webdev91Author
New Participant
June 27, 2023

Hi @salamswapnil

Thank you for the clarification.

The problem is we have separate Maven projects for each site so I believe keeping a translation_rules.xml file in sync across the Maven projects will be challenging. Any suggestions in this scenario?

salamswapnilAccepted solution
New Participant
June 29, 2023

@webdev91 

I am not sure if AEM or maven has any straight forward solution to this issue. 

One probable solution I can think of is You can create a one more maven project dedicated for translation rules file and all teams utilize it for their respective changes and remove translation rules file from all other projects.